Sha256: 0d591a480829bd00096be9531e92d739f0184e25dd0078a01a9bb13f801aab3b

Contents?: true

Size: 1.16 KB

Versions: 208

Compression:

Stored size: 1.16 KB

Contents

import transform from './etl';

describe('Transform', () => {

  it('transforms one value', () => {
    const old = { 1: [ 'A' ] };
    const expected = { a: 1 };

    expect(transform(old)).toEqual(expected);
  });

  xit('transforms more values', () => {
    const old = { 1: [ 'A', 'E', 'I', 'O', 'U' ] };
    const expected = { a: 1, e: 1, i: 1, o: 1, u: 1 };

    expect(transform(old)).toEqual(expected);
  });

  xit('transforms more keys', () => {
    const old = { 1: [ 'A', 'E' ], 2: [ 'D', 'G' ] };
    const expected = { a: 1, e: 1, d: 2, g: 2 };

    expect(transform(old)).toEqual(expected);
  });

  xit('transforms a full dataset', () => {
    const old = {
      1: [ 'A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T' ],
      2: [ 'D', 'G' ],
      3: [ 'B', 'C', 'M', 'P' ],
      4: [ 'F', 'H', 'V', 'W', 'Y' ],
      5: [ 'K' ],
      8: [ 'J', 'X' ],
      10: [ 'Q', 'Z' ]
    };
    const expected = {
      a: 1, b: 3,  c: 3, d: 2, e: 1,
      f: 4, g: 2,  h: 4, i: 1, j: 8,
      k: 5, l: 1,  m: 3, n: 1, o: 1,
      p: 3, q: 10, r: 1, s: 1, t: 1,
      u: 1, v: 4,  w: 4, x: 8, y: 4,
      z: 10
    };

    expect(transform(old)).toEqual(expected);
  });

});

Version data entries

208 entries across 208 versions & 1 rubygems

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