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
This came up in material2 tests.
The testing zone that
angular2/testinguses for determining async behavior seems to ignore XHR requests. This means that components with atemplateUrlcan cause tests to exit early.Example:
cc @jelbourn