Sha256: 25110b96da13a0c697990429c065dadc94f639aafcd16878cbc051f61731d92d

Contents?: true

Size: 893 Bytes

Versions: 141

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

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.158 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.157 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.156 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.155 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.154 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.153 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.152 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.151 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.150 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.149 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.148 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.147 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.146 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.145 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.144 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.143 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.142 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.141 tracks/javascript/exercises/luhn/luhn.spec.js
trackler-2.2.1.140 tracks/javascript/exercises/luhn/luhn.spec.js