O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Expects

We test the functionality of our code by writing expects that are no more than simple assumptions that we have for our code if everything was implemented correctly. In the file we are working on, apply the following changes:

...describe("Calculator", function() {   it("should return the addition ", function() {       expect(Calculator.add(1, 2)).toEqual(3);   });   it("should return the substraction ", function() {       expect(Calculator.substract(1, 2)).toEqual(-1);   });   it("should return the multiplication ", function() {       expect(Calculator.multiply(1, 2)).toEqual(2);   })    it("should return the division ", function() {       expect(Calculator.divide(1, 2)).toEqual(0.5);   })});

We have created the expectations that we have for our code. For example, for the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required