Skip to content

Commit

Permalink
fix(testing): improve misleading error message when don't call compil…
Browse files Browse the repository at this point in the history
…eComponents

Closes angular#11301
  • Loading branch information
Dzmitry Shylovich authored and Dzmitry Shylovich committed Dec 17, 2016
1 parent 0e3981a commit 1645422
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/@angular/core/testing/test_bed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,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();
Expand Down

0 comments on commit 1645422

Please sign in to comment.