Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ef92c3

Browse files
author
Matias Niemela
committed
revert: feat(ngMock): destroy $rootScope after each test
1 parent 1467e15 commit 2ef92c3

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/ngMock/angular-mocks.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,6 @@ if (window.jasmine || window.mocha) {
23302330
}
23312331
angular.element.cleanData(cleanUpNodes);
23322332

2333-
injector.get('$rootScope').$destroy();
23342333
}
23352334

23362335
// clean up jquery's fragment cache

test/ngMock/angular-mocksSpec.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,25 +1603,6 @@ describe('ngMock', function() {
16031603
});
16041604

16051605

1606-
describe('$rootScope', function() {
1607-
var destroyed = false;
1608-
var oldRootScope;
1609-
1610-
it('should destroy $rootScope after each test', inject(function($rootScope) {
1611-
$rootScope.$on('$destroy', function() {
1612-
destroyed = true;
1613-
});
1614-
oldRootScope = $rootScope;
1615-
}));
1616-
1617-
it('should have destroyed the $rootScope from the previous test', inject(function($rootScope) {
1618-
expect(destroyed).toBe(true);
1619-
expect($rootScope).not.toBe(oldRootScope);
1620-
expect(oldRootScope.$$destroyed).toBe(true);
1621-
}));
1622-
});
1623-
1624-
16251606
describe('$rootScopeDecorator', function() {
16261607

16271608
describe('$countChildScopes', function() {

0 commit comments

Comments
 (0)