June 2018
Intermediate to advanced
348 pages
8h 19m
English
We need to ensure that our data is retrieved as expected, and the same way, we need to assert that our component behavior is going well too. To do this, we can tell the component we created that we will manually handle the life cycle methods; you will find the code very self-explanatory:
import {StageComponent} from 'aurelia-testing';import {bootstrap} from 'aurelia-bootstrapper';describe('CustomerComponent', () => { let component; beforeEach(() => { component = StageComponent .withResources('src/customer-component') .inView('<customer-component cust-name.bind="custName"></customer-component>') .boundTo({ custName: 'Diego' }); }); it('can manually handle life cycle', done => { let nameElement; component.manuallyHandleLifecycle(). ...
Read now
Unlock full access