Sha256: f0b8959f9ae6e3554c6291a6d543c610016cefa8c07e8680a496917b343b236b

Contents?: true

Size: 893 Bytes

Versions: 183

Compression:

Stored size: 893 Bytes

Contents

var Luhn = require('./luhn');

describe('Luhn',function() {

  it('single digit strings can not be valid', function () {
    const luhn = new Luhn('1');
    expect(luhn.valid).toEqual(false);
  });

  xit('A single zero is invalid', function () {
    const luhn = new Luhn('0');
    expect(luhn.valid).toEqual(false);
  });

  xit('valid Canadian SIN', function () {
    const luhn = new Luhn('046 454 286');
    expect(luhn.valid).toEqual(true);
  });

  xit('invalid Canadian SIN', function () {
    const luhn = new Luhn('046 454 287');
    expect(luhn.valid).toEqual(false);
  });

  xit('invalid credit card', function () {
    const luhn = new Luhn('8273 1232 7352 0569');
    expect(luhn.valid).toEqual(false);
  });

  xit('valid strings with a non-digit added become invalid', function () {
    const luhn = new Luhn('046a 454 286');
    expect(luhn.valid).toEqual(false);
  });

});

Version data entries

183 entries across 183 versions & 1 rubygems

Version Path
trackler-2.2.1.37 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.36 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.35 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.34 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.33 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.32 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.31 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.30 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.29 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.28 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.27 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.26 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.25 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.24 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.23 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.22 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.21 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.20 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.19 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.18 tracks/javascript/exercises/luhn/luhn.spec.js