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

Fix ngMock window.inject() error stack trace reporting on repeated or non-initial injection function calls for the master branch (issue #13594) #13598

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
refactor(ngMock window.inject test): comment on important function wr…
…apper usage

Explicitly commented on why we use an extra function wrapper around the
test inject Error throwing code, and how not using it would make our
tests give us false positives on certain browsers, e.g. Firefox.
  • Loading branch information
jurko-gospodnetic committed Apr 11, 2016
commit 4e78a7f9dd027de6a7976f2b605aaf794b7e3446
3 changes: 3 additions & 0 deletions test/ngMock/angular-mocksSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ describe('ngMock', function() {
// call in multiple test specs
function testInjectCaller() {
var shouldThrow;
// using an extra internalInjectCaller() wrapper here avoids stack trace
// constructed by some browsers (e.g. FireFox) from containing the name
// of the external caller function
var injectingCall = (function internalInjectCaller() {
return inject(function() {
if (shouldThrow)
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy