fix(testing): improve misleading error message when don't call compileComponents (#13543)

Closes #11301
This commit is contained in:
Dzmitry Shylovich 2016-12-22 23:35:57 +03:00 committed by Hans
parent f114e40212
commit 67380d4b28
2 changed files with 2 additions and 2 deletions

View File

@ -267,7 +267,7 @@ export class TestBed implements Injector {
} catch (e) { } catch (e) {
if (e.compType) { if (e.compType) {
throw new Error( 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.`); `Please call "TestBed.compileComponents" before your test.`);
} else { } else {
throw e; throw e;

View File

@ -503,7 +503,7 @@ export function main() {
{declarations: [CompWithUrlTemplate]}, {declarations: [CompWithUrlTemplate]},
() => TestBed.createComponent(CompWithUrlTemplate)))) () => TestBed.createComponent(CompWithUrlTemplate))))
.toThrowError( .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.`); `Please call "TestBed.compileComponents" before your test.`);
restoreJasmineIt(); restoreJasmineIt();