Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 1be8347

Browse files
CaerusKaruThomasBurleson
authored andcommitted
build: fix runtime errors not being logged out on karma initialization
* Equivalent commit to angular/material#9888
1 parent 5ffb39c commit 1be8347

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/karma-test-shim.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ System.config({
8383
});
8484

8585
// Configure the Angular test bed and run all specs once configured.
86-
configureTestBed()
86+
configureTestBed()
8787
.then(runSpecs)
88-
.then(__karma__.start, __karma__.error);
88+
.then(__karma__.start, function(error) {
89+
// Passing in the error object directly to Karma won't log out the stack trace and
90+
// passing the `originalErr` doesn't work correctly either. We have to log out the
91+
// stack trace so we can actually debug errors before the tests have started.
92+
console.error(error.originalErr.stack);
93+
__karma__.error(error);
94+
});
8995

9096

9197
/** Runs the specs in Karma. */

0 commit comments

Comments
 (0)