June 2018
Intermediate to advanced
348 pages
8h 19m
English
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>'); ...Read now
Unlock full access