Files
30-seconds-of-code/test/luhnCheck/luhnCheck.test.js
2018-06-18 17:31:56 +03:00

16 lines
475 B
JavaScript

const expect = require('expect');
const luhnCheck = require('./luhnCheck.js');
test('luhnCheck is a Function', () => {
expect(luhnCheck).toBeInstanceOf(Function);
});
test('validates identification number', () => {
expect(luhnCheck(6011329933655299)).toBeFalsy();
});
test('validates identification number', () => {
expect(luhnCheck('4485275742308327')).toBeTruthy();
});
test('validates identification number', () => {
expect(luhnCheck(123456789)).toBeFalsy();
});