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

Testing the component

Now that we have our component created, we need to test it. To do this, we rely on the done callback passed to the test function to notify Jasmine that the test is done. If we don't specify the done parameter, our test won't be executed because we execute our assertions in a promise and if we don't call it, we will get a timeout error since Jasmine won't be able to know when our test completed. Let's apply the following changes to the info-box.spec.js file:

 import {StageComponent} from 'aurelia-testing'; import {bootstrap} from 'aurelia-bootstrapper'; describe('Info-Box', () => {   it('should render the username and topic', done => {     let component = StageComponent               .withResources('info-box')  .inView('<info-box></info-box>'); ...

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