Sha256: 4a01cb65c873740d1236fd7cc2357681c83f79632684950c0485e32367e388cf
Contents?: true
Size: 860 Bytes
Versions: 185
Compression:
Stored size: 860 Bytes
Contents
import Luhn from './luhn'; describe('Luhn', () => { test('single digit strings can not be valid', () => { const luhn = new Luhn('1'); expect(luhn.valid).toEqual(false); }); xtest('A single zero is invalid', () => { const luhn = new Luhn('0'); expect(luhn.valid).toEqual(false); }); xtest('valid Canadian SIN', () => { const luhn = new Luhn('046 454 286'); expect(luhn.valid).toEqual(true); }); xtest('invalid Canadian SIN', () => { const luhn = new Luhn('046 454 287'); expect(luhn.valid).toEqual(false); }); xtest('invalid credit card', () => { const luhn = new Luhn('8273 1232 7352 0569'); expect(luhn.valid).toEqual(false); }); xtest('valid strings with a non-digit added become invalid', () => { const luhn = new Luhn('046a 454 286'); expect(luhn.valid).toEqual(false); }); });
Version data entries
185 entries across 185 versions & 1 rubygems