Sha256: 2df5d1ed49cd7721e76fea427010911fac1efd9a1ea3f25eef0b58c3bee863b2

Contents?: true

Size: 837 Bytes

Versions: 141

Compression:

Stored size: 837 Bytes

Contents

var Triangle = require('./pascals-triangle');

describe('Triangle', function () {
  it('with one row', function () {
    expect(new Triangle(1).rows).toEqual([[1]]);
  });

  xit('with two rows', function () {
    expect(new Triangle(2).rows).toEqual([[1], [1, 1]]);
  });

  xit('with three rows', function () {
    expect(new Triangle(3).rows).toEqual([[1], [1, 1], [1, 2, 1]]);
  });

  xit('last row', function () {
    expect(new Triangle(4).lastRow).toEqual([1, 3, 3, 1]);
  });

  xit('fifth row', function () {
    expect(new Triangle(5).lastRow).toEqual([1, 4, 6, 4, 1]);
  });

  xit('twentieth row', function () {
    var twentieth = [1, 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1];
    expect(new Triangle(20).lastRow)
      .toEqual(twentieth);
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.78 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.77 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.76 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.75 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.74 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.73 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.72 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.71 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.70 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.69 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.68 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.67 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.66 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.65 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.64 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.63 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.62 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.61 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.60 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.59 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js