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