Sha256: 00b33e5a1ead3c81711f2b667e8f006c888c16e714feb580e5aaf44e40f676a1

Contents?: true

Size: 1.4 KB

Versions: 208

Compression:

Stored size: 1.4 KB

Contents

import Hexadecimal from './hexadecimal';

describe('Hexadecimal', () => {

 it('hex 1 is decimal 1', () => {
    const hex = new Hexadecimal('1');
    expect(hex.toDecimal()).toEqual(1);
  });

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

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

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

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

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

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

  xit('hexadecimal value for HTML/CSS black color', () => {
    const hex = new Hexadecimal('000000');
    expect(hex.toDecimal()).toEqual(0);
  });

 xit('hexadecimal value for HTML/CSS white color', () => {
    const hex = new Hexadecimal('ffffff');
    expect(hex.toDecimal()).toEqual(16777215);
  });

 xit('hexadecimal value for HTML/CSS yellow color', () => {
    const hex = new Hexadecimal('ffff00');
    expect(hex.toDecimal()).toEqual(16776960);
  });

});

Version data entries

208 entries across 208 versions & 1 rubygems

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