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

Writing the test

Before we start writing our test, let's clean up the test folder by removing the app.spec.js file in the unit folder. Once completed, you should have something similar to folder tree:

.├── aurelia-karma.js└── unit    └── setup.js

In the unit folder, create the info-box.spec.js file and add the following code:

 import {StageComponent} from 'aurelia-testing'; import {bootstrap} from 'aurelia-bootstrapper'; describe('Info-Box', () => {   it('should render the username and topic', () => {   }); });

First, we import two objects from the Aurelia framework that we will use to initialize our info-box component. Then, we declare our Info-Box test suite and we declare one test case.

Note that we are using a special syntax; instead of using ...

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