Sha256: 50576ff9b90956c351b4d16aafab8cf2e4a435ac84f5021d2f5a139196cd0b6f

Contents?: true

Size: 1.34 KB

Versions: 141

Compression:

Stored size: 1.34 KB

Contents

var Hexadecimal = require('./hexadecimal');

describe('Hexadecimal', function () {
  it('hex 1 is decimal 1', function () {
    var hex = new Hexadecimal('1');
    expect(hex.toDecimal()).toEqual(1);
  });

  xit('hex c is decimal 12', function () {
    var hex = new Hexadecimal('c');
    expect(hex.toDecimal()).toEqual(12);
  });

  xit('hex 10 is decimal 16', function () {
    var hex = new Hexadecimal('10');
    expect(hex.toDecimal()).toEqual(16);
  });

  xit('hex af is decimal 175', function () {
    var hex = new Hexadecimal('af');
    expect(hex.toDecimal()).toEqual(175);
  });

  xit('hex 100 is decimal 256', function () {
    var hex = new Hexadecimal('100');
    expect(hex.toDecimal()).toEqual(256);
  });

  xit('hex 19ace is decimal 105166', function () {
    var hex = new Hexadecimal('19ace');
    expect(hex.toDecimal()).toEqual(105166);
  });

  xit('invalid hex is decimal 0', function () {
    var hex = new Hexadecimal('carrot');
    expect(hex.toDecimal()).toEqual(0);
  });

  xit('black', function () {
    var hex = new Hexadecimal('000000');
    expect(hex.toDecimal()).toEqual(0);
  });

  xit('white', function () {
    var hex = new Hexadecimal('ffffff');
    expect(hex.toDecimal()).toEqual(16777215);
  });

  xit('yellow', function () {
    var hex = new Hexadecimal('ffff00');
    expect(hex.toDecimal()).toEqual(16776960);
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

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