-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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", () => { |
There was a problem hiding this comment.
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.
@agarwalaman263 The CodeFactor checks are failing. Please check here. |
I have committed the required changes |
demo.js is created with the initial code and a new /tests/ directory is created for the test case files. |
@agarwalaman263 That's awesome. I'll review and merge it soon. You may find a few more issues here! |
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