aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMisko Hevery2012-05-09 19:10:05 -0400
committerIgor Minar2012-05-14 21:56:22 -0700
commit24e7da4f1954dbe2e89f82950ed00292678534fd (patch)
tree016a7355fbc57e19f73918680e0a7dffc73b57e5 /src
parent7b739c97028be2a5d5aef679ef1f8064cd10d386 (diff)
downloadangular.js-24e7da4f1954dbe2e89f82950ed00292678534fd.tar.bz2
fix(angular-mocks): memory leak in jasmine's DI utils
When using inject/module helper methods in tests, these methods would leave the injector laying around after the test. Since injector is the application it can grow very large.
Diffstat (limited to 'src')
-rw-r--r--src/ngMock/angular-mocks.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js
index a2d4f88b..b0f6383a 100644
--- a/src/ngMock/angular-mocks.js
+++ b/src/ngMock/angular-mocks.js
@@ -1546,6 +1546,12 @@ window.jstestdriver && (function(window) {
window.jasmine && (function(window) {
+ afterEach(function() {
+ var spec = getCurrentSpec();
+ spec.$injector = null;
+ spec.$modules = null;
+ });
+
function getCurrentSpec() {
return jasmine.getEnv().currentSpec;
}