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

Version Path
trackler-2.1.0.53 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.52 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.51 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.50 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.49 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.48 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.47 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.46 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.45 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.44 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.43 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.42 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.41 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.40 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.39 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.38 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.37 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.36 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.34 tracks/ecmascript/exercises/luhn/luhn.spec.js
trackler-2.1.0.33 tracks/ecmascript/exercises/luhn/luhn.spec.js