fix(testing): improve misleading error message when don't call compileComponents (#13543)
Closes #11301
This commit is contained in:

committed by
Igor Minar

parent
28a92b2bcd
commit
0e7f9f0bff
@ -262,7 +262,7 @@ export class TestBed implements Injector {
|
||||
} catch (e) {
|
||||
if (e.compType) {
|
||||
throw new Error(
|
||||
`This test module uses the component ${stringify(e.compType)} which is using a "templateUrl", but they were never compiled. ` +
|
||||
`This test module uses the component ${stringify(e.compType)} which is using a "templateUrl" or "styleUrls", but they were never compiled. ` +
|
||||
`Please call "TestBed.compileComponents" before your test.`);
|
||||
} else {
|
||||
throw e;
|
||||
|
@ -488,7 +488,7 @@ export function main() {
|
||||
{declarations: [CompWithUrlTemplate]},
|
||||
() => TestBed.createComponent(CompWithUrlTemplate))))
|
||||
.toThrowError(
|
||||
`This test module uses the component ${stringify(CompWithUrlTemplate)} which is using a "templateUrl", but they were never compiled. ` +
|
||||
`This test module uses the component ${stringify(CompWithUrlTemplate)} which is using a "templateUrl" or "styleUrls", but they were never compiled. ` +
|
||||
`Please call "TestBed.compileComponents" before your test.`);
|
||||
|
||||
restoreJasmineIt();
|
||||
|
Reference in New Issue
Block a user