Correctly implement luhnCheck

This commit is contained in:
Tom Targosz
2020-02-07 13:29:20 -06:00
parent e9645c3b96
commit 3117cf4ee2
5 changed files with 13 additions and 7 deletions

View File

@ -3,10 +3,16 @@ const {luhnCheck} = require('./_30s.js');
test('luhnCheck is a Function', () => {
expect(luhnCheck).toBeInstanceOf(Function);
});
test('validates identification number', () => {
expect(luhnCheck(6011329933655299)).toBeFalsy();
test('invalidates an incorrect identification number', () => {
expect(luhnCheck(6011329933655298)).toBeFalsy();
});
test('validates identification number', () => {
test('validates a correct identification number', () => {
expect(luhnCheck(6011329933655299)).toBeTruthy();
});
test('validates a correct identification number', () => {
expect(luhnCheck(5105105105105100)).toBeTruthy();
});
test('validates a correct identification number', () => {
expect(luhnCheck('4485275742308327')).toBeTruthy();
});
test('validates identification number', () => {