Unit Testing
Getting Started
Installation
npm install aurelia-testing --save-devBasic Test Setup
import { StageComponent } from 'aurelia-testing';
import { bootstrap } from 'aurelia-bootstrapper';
describe('MyComponent', () => {
let component;
beforeEach(() => {
component = StageComponent
.withResources('my-component')
.inView('<my-component></my-component>');
});
afterEach(() => {
component.dispose();
});
it('should render', done => {
component.create(bootstrap).then(() => {
expect(document.querySelector('my-component')).not.toBeNull();
done();
}).catch(done.fail);
});
});Testing Without the DOM
What's Covered
Last updated
Was this helpful?