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

Test cases

To write the test for our applications, we need test cases that should basically consider all the possible scenarios that your app can afford. For our Calculator example, we will create test cases for the four main arithmetic operations—addition, multiplication, subtraction, and division. Test cases are created using the it function, as follows:

describe("Calculator", function() {   it("should return the addition ", function() {       ...   });   it("should return the substraction ", function() {       ...   });   it("should return the multiplication ", function() {       ...   })   it("should return the division ", function() {       ...   })});

Before we continue on our trip, we should have something to test. So let's create a Calculator object to test out. In 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