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.
This commit is contained in:
Misko Hevery 2012-05-09 19:10:05 -04:00 committed by Igor Minar
parent 7b739c9702
commit 24e7da4f19

View file

@ -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;
}