test(ngMocks): prevent Safari 10+ optimization that breaks test

This commit is contained in:
Georgios Kalpakas
2016-12-07 21:37:36 +02:00
parent 6b3da2ddfe
commit 1d2f5e41b7
+4 -3
View File
@@ -936,9 +936,10 @@ describe('ngMock', function() {
})();
function testCaller() {
return inject(function() {
throw new Error();
});
// Assigning to a local variable first, prevents Safari 10+ from inlining
// the function call and having it appear as anonymous in the stack trace.
var fn = inject(function() { throw new Error(); });
return fn;
}
var throwErrorFromInjectCallback = testCaller();