File tree Expand file tree Collapse file tree
scaffold-minimum/test__if_karma_or_jest/unit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "devDependencies" : {
33 "jest" : " " ,
44 "jest-cli" : " " ,
5+ "jest-transform-stub" : " " ,
56 "aurelia-loader-nodejs" : " " ,
67 "aurelia-pal-nodejs" : " " ,
78
3435 " json"
3536 ],
3637 "transform" : {
38+ "^.+\\ .(css|less|sass|scss|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$" : " jest-transform-stub" ,
3739 // @if feat.babel
3840 "^.+\\ .js$" : " babel-jest" ,
3941 // @endif
8183 " html"
8284 ]
8385 }
84- }
86+ }
Original file line number Diff line number Diff line change 1+ import {bootstrap} from 'aurelia-bootstrapper';
12import {App} from '../../src/app';
3+ import {StageComponent} from 'aurelia-testing';
24
35describe('the app', () => {
46 it('says hello', () => {
57 expect(new App().message).toBe('Hello World!');
68 });
79});
10+
11+ describe('Stage App Component', () => {
12+ let component;
13+
14+ beforeEach(() => {
15+ component = StageComponent
16+ .withResources('app')
17+ .inView('<app></app>');
18+ });
19+
20+ afterEach(() => component.dispose());
21+
22+ it('should render message', done => {
23+ component.create(bootstrap).then(() => {
24+ const view = component.element;
25+ expect(view.textContent.trim()).toBe('Hello World!');
26+ done();
27+ }).catch(e => {
28+ fail(e);
29+ done();
30+ });
31+ });
32+ });
You can’t perform that action at this time.
0 commit comments