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

Add More options to call 619 ("Booyakah") Number and Unit Test #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ function isEven(number) {
else if(number === 616 || number === "616" || number === "six hundred sixteen" || number === "Six Hundred Sixteen" || number === "SIX HUNDRED SIXTEEN") return true;
else if(number === 617 || number === "617" || number === "six hundred seventeen" || number === "Six Hundred Seventeen" || number === "SIX HUNDRED SEVENTEEN") return false;
else if(number === 618 || number === "618" || number === "six hundred eighteen" || number === "Six Hundred Eighteen" || number === "SIX HUNDRED EIGHTEEN") return true;
else if(number === 619 || number === "619" || number === "six hundred nineteen" || number === "Six Hundred Nineteen" || number === "SIX HUNDRED NINETEEN") return false;
else if(number === 619 || number === "619" || number === "six hundred nineteen" || number === "Six Hundred Nineteen" || number === "SIX HUNDRED NINETEEN" || number === 'SixOneNine' || number === 'sixonenine' || number === 'SIXONENINE' || number === 'Six One Nine' || number === 'six one nine' || number === 'SIX ONE NINE' ) return false;
else if(number === 620 || number === "620" || number === "six hundred twenty" || number === "Six Hundred Twenty" || number === "SIX HUNDRED TWENTY") return true;
else if(number === 621 || number === "621" || number === "six hundred twenty-one" || number === "Six Hundred Twenty-One" || number === "SIX HUNDRED TWENTY-ONE") return false;
else if(number === 622 || number === "622" || number === "six hundred twenty-two" || number === "Six Hundred Twenty-Two" || number === "SIX HUNDRED TWENTY-TWO") return true;
Expand Down
62 changes: 62 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
var iseven = require('./index');
describe('Is Even test', () => {
test('is 1 even expect false', ()=> {
expect(iseven(1)==false);
});

test('is \"1\" even expect false', ()=> {
expect(iseven("1")==false);
});

test('is \"one\" even expect false', ()=> {
expect(iseven("one")==false);
});

test('is \"One\" even expect false', ()=> {
expect(iseven("One")==false);
});

test('is \"ONE\" even expect false', ()=> {
expect(iseven("ONE")==false);
});
test('is 619 even expect false', ()=> {
expect(iseven(619)==false);
});

test('is \"619\" even expect false', ()=> {
expect(iseven("619")==false);
});

test('is \"six hundred nineteen\" even expect false', ()=> {
expect(iseven("six hundred nineteen")==false);
});

test('is \"Six Hundred Nineteen\" even expect false', ()=> {
expect(iseven("Six Hundred Nineteen")==false);
});
test('is \"SIX HUNDRED NINETEEN\" even expect false', ()=> {
expect(iseven("SIX HUNDRED NINETEEN")==false);
});
test('is \"SixOneNine\" even expect false', ()=> {
expect(iseven("SixOneNine")==false);
});
test('is \"sixonenine\" even expect false', ()=> {
expect(iseven("sixonenine")==false);
});
test('is \"SIXONENINE\" even expect false', ()=> {
expect(iseven("SIXONENINE")==false);
});
test('is \"Six One Nine\" even expect false', ()=> {
expect(iseven("Six One Nine")==false);
});
test('is \"six one nine\" even expect false', ()=> {
expect(iseven("six one nine")==false);
});
test('is \"SIX ONE NINE\" even expect false', ()=> {
expect(iseven("SIX ONE NINE")==false);
});




});
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"bugs": {
"url": "https://github.com/samuelmarina/is-even/issues"
},
"homepage": "https://github.com/samuelmarina/is-even#readme"
"homepage": "https://github.com/samuelmarina/is-even#readme",
"devDependencies": {
"jest": "^28.1.1"
}
}