revert: fix(ivy): Only restore registered modules if user compiles modules with TestBed (#32944) (#33663)

This commit reverts 63256b5.

PR Close #33663
This commit is contained in:
Andrew Scott
2019-11-08 10:16:40 -08:00
committed by Kara Erickson
parent a972e4cd4d
commit e1ee90c218
5 changed files with 23 additions and 47 deletions

View File

@ -17,7 +17,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
import {modifiedInIvy, obsoleteInIvy, onlyInIvy} from '@angular/private/testing';
import {InternalNgModuleRef, NgModuleFactory} from '../../src/linker/ng_module_factory';
import {clearRegisteredModuleState} from '../../src/linker/ng_module_factory_registration';
import {clearModuleRegistry} from '../../src/linker/ng_module_factory_registration';
import {stringify} from '../../src/util/stringify';
class Engine {}
@ -294,7 +294,11 @@ function declareTests(config?: {useJit: boolean}) {
describe('id', () => {
const token = 'myid';
afterEach(() => clearRegisteredModuleState());
// Ivy TestBed clears module registry in resetTestingModule so this afterEach is not needed
// for Ivy
if (!ivyEnabled) {
afterEach(() => clearModuleRegistry());
}
it('should register loaded modules', () => {
@NgModule({id: token})