-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Closed
Labels
area: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBedtype: bug/fix
Milestone
Description
This came up in material2 tests.
The testing zone that angular2/testing uses for determining async behavior seems to ignore XHR requests. This means that components with a templateUrl can cause tests to exit early.
Example:
@Component({
selector: 'my-comp',
template: `<span>Hello</span>`,
})
class TemplateComp {
}
@Component({
selector: 'my-comp',
templateUrl: '/foo/bar'
})
class TemplateUrlComp {
}
// GOOD: this one correctly fails
it('should fail here 2',
injectAsync([], () => {
return builder.createAsync(TemplateComp).then((fixture) => {
expect(11).toBe(22);
});
}));
// BAD: this one DOES NOT fail
it('should fail here 2',
injectAsync([], () => {
return builder.createAsync(TemplateUrlComp).then((fixture) => {
expect(33).toBe(44);
});
}));cc @jelbourn
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 TestBedtype: bug/fix