-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
area: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBedhotlist: components teamRelated to Angular CDK or Angular MaterialRelated to Angular CDK or Angular Material
Description
Following test fails as expected (http://plnkr.co/edit/61ByTt?p=preview):
@Component({
selector: 'header',
template: '<h1>Hello Welt!</h1>'
})
export class TestComponent2 {
}
describe('TestComponent', () => {
it('should fail', inject([TestComponentBuilder], (tcb) => {
return tcb.createAsync(TestComponent2).then((fixture) => {
fixture.detectChanges();
expect(1).toEqual(2);
});
}));
)};
Moving the template to an external resource, the test passes without failing (the async part doesn't get executed) (http://plnkr.co/edit/ZOeFTO?p=preview):
@Component({
selector: 'header',
templateUrl: 'src/test.html'
})
export class TestComponent {
}
describe('TestComponent', () => {
it('should fail', inject([TestComponentBuilder], (tcb) => {
return tcb.createAsync(TestComponent).then((fixture) => {
fixture.detectChanges();
expect(1).toEqual(2);
});
}));
)};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBedhotlist: components teamRelated to Angular CDK or Angular MaterialRelated to Angular CDK or Angular Material