Sha256: 3d751370102f1054b2ceb4c8eccd3aa31869c9af7ef24e2129d4da2185226472

Contents?: true

Size: 1.2 KB

Versions: 141

Compression:

Stored size: 1.2 KB

Contents

var ETL = require('./etl');

describe('Transform', function () {
  var etl = new ETL();

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

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

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

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

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

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

  xit('transforms a full dataset', function () {
    var 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' ]
    };
    var 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(etl.transform(old)).toEqual(expected);
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.138 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.137 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.136 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.135 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.134 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.133 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.132 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.131 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.130 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.129 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.128 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.127 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.126 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.125 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.124 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.123 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.122 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.121 tracks/javascript/exercises/etl/etl.spec.js
trackler-2.2.1.120 tracks/javascript/exercises/etl/etl.spec.js