Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 8f4bcc7

Browse files
authored
build: fix runtime errors not being logged out on karma initialization (#74)
* Equivalent commit to angular/components#9888
1 parent 3aff659 commit 8f4bcc7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

karma-test-shim.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ System.config({
7070
// Configure the Angular test bed and run all specs once configured.
7171
configureTestBed()
7272
.then(runSpecs)
73-
.then(__karma__.start, __karma__.error);
73+
.then(__karma__.start, function(error) {
74+
// Passing in the error object directly to Karma won't log out the stack trace and
75+
// passing the `originalErr` doesn't work correctly either. We have to log out the
76+
// stack trace so we can actually debug errors before the tests have started.
77+
console.error(error.originalErr.stack);
78+
__karma__.error(error);
79+
});
7480

7581

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

0 commit comments

Comments
 (0)