Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test for checking the duplicity of quotes in data.json #190

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Unit test for checking the duplicity of quotes in data.json #190

wants to merge 9 commits into from

Conversation

agarwalaman263
Copy link

The test case for checking duplicate quotes is added. It first cleans the data by replacing all the punctuations and removal of spaces and then checks the data for duplicates.
Currently at the time of PR, there are about 10 duplicates present, so the test case is failing.

Issue #120

@vinitshahdeo vinitshahdeo self-requested a review October 6, 2019 06:56
Copy link
Owner

@vinitshahdeo vinitshahdeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the changes in test.js in root directory. My bad, this file is wrongly named, actually, it should be demo.js.

Create a directory tests/ and add your test files there.

test.js Outdated

var Quote = quote.getQuote();
describe("Test Suite", () => {
it("test for Duplicacy of quotes", () => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

describe blocks should match the thing you're testing. it blocks should match what behavior you're testing for. The assertions inside the it should describe how you're validation the behavior.

for this case:

describe("data.json", () => {
    it("should not contain any duplicate quotes", () => {

Now, it reads like a sentence. Later, if we add a few more tests it'll be more readable.

@vinitshahdeo
Copy link
Owner

@agarwalaman263 The CodeFactor checks are failing. Please check here.

@vinitshahdeo vinitshahdeo added enhancement New feature or request hacktoberfest Send PR and earn a free t-shirt good first issue Good for newcomers help wanted Extra attention is needed labels Oct 6, 2019
@agarwalaman263
Copy link
Author

I have committed the required changes

@agarwalaman263
Copy link
Author

demo.js is created with the initial code and a new /tests/ directory is created for the test case files.

@vinitshahdeo vinitshahdeo changed the title Test cases for checking the duplicity of data Unit test for checking the duplicity of quotes in data.json Oct 6, 2019
@vinitshahdeo
Copy link
Owner

@agarwalaman263 That's awesome. I'll review and merge it soon. You may find a few more issues here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Send PR and earn a free t-shirt help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants