formations/javascript/base/ecosysteme-3.md

533 B

.cadoles-slide-title[Écosystème (3/7)]

Les tests unitaires

Différentes librairies, différents styles...

NodeUnit

this.MathSuite = {

  'should return the square root of 8': function(test) {
    test.ok( Math.sqrt(4) === 2, 'It should return 2 !');
    test.done();
  }

};

Jasmine

describe('Math', function() {

  it('should return the square root of 8', function(done) {
    expect( Math.sqrt(4) ).toBe(2);
    done();
  });

});