Sha256: 5a0a62d84e56092e2f5a82786b0ffe31ea24163482df9f461bcb47fa42ea32a4

Contents?: true

Size: 839 Bytes

Versions: 255

Compression:

Stored size: 839 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

255 entries across 255 versions & 1 rubygems

Version Path
trackler-2.2.1.37 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.36 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.35 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.34 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.33 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.32 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.31 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.30 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.29 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.28 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.27 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.26 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.25 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.24 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.23 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.22 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.21 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.20 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.19 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js
trackler-2.2.1.18 tracks/javascript/exercises/pascals-triangle/pascals-triangle.spec.js