diff --git a/test/karma-test-shim.js b/test/karma-test-shim.js index 8a69f544e98..b3528b9b3e4 100644 --- a/test/karma-test-shim.js +++ b/test/karma-test-shim.js @@ -117,9 +117,15 @@ System.config({ }); // Configure the Angular test bed and run all specs once configured. - configureTestBed() +configureTestBed() .then(runMaterialSpecs) - .then(__karma__.start, __karma__.error); + .then(__karma__.start, function(error) { + // Passing in the error object directly to Karma won't log out the stack trace and + // passing the `originalErr` doesn't work correctly either. We have to log out the + // stack trace so we can actually debug errors before the tests have started. + console.error(error.originalErr.stack); + __karma__.error(error); + }); /** Runs the Angular Material specs in Karma. */