revert: fix(ivy): R3TestBed should clean up registered modules after each test (#32872) (#33663)

This commit reverts 475e36a.

PR Close #33663
This commit is contained in:
Andrew Scott
2019-11-08 10:18:46 -08:00
committed by Kara Erickson
parent f8e9c1e6f1
commit 7c4366dce8
4 changed files with 4 additions and 29 deletions

View File

@ -6,13 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
<<<<<<< HEAD
import {Compiler, Component, Directive, ErrorHandler, Inject, Injectable, InjectionToken, Injector, Input, ModuleWithProviders, NgModule, Optional, Pipe, getModuleFactory, ɵsetClassMetadata as setClassMetadata, ɵɵdefineComponent as defineComponent, ɵɵdefineNgModule as defineNgModule, ɵɵtext as text} from '@angular/core';
import {registerModuleFactory} from '@angular/core/src/linker/ng_module_factory_registration';
import {NgModuleFactory} from '@angular/core/src/render3';
=======
import {Compiler, Component, Directive, ErrorHandler, Inject, Injectable, InjectionToken, Input, ModuleWithProviders, NgModule, Optional, Pipe, getModuleFactory, ɵsetClassMetadata as setClassMetadata, ɵɵdefineComponent as defineComponent, ɵɵdefineNgModule as defineNgModule, ɵɵtext as text} from '@angular/core';
>>>>>>> parent of 63256b511a... fix(ivy): Only restore registered modules if user compiles modules with TestBed (#32944)
import {Compiler, Component, Directive, ErrorHandler, Inject, Injectable, InjectionToken, Injector, Input, ModuleWithProviders, NgModule, Optional, Pipe, ɵsetClassMetadata as setClassMetadata, ɵɵdefineComponent as defineComponent, ɵɵdefineNgModule as defineNgModule, ɵɵtext as text} from '@angular/core';
import {TestBed, getTestBed} from '@angular/core/testing/src/test_bed';
import {By} from '@angular/platform-browser';
import {expect} from '@angular/platform-browser/testing/src/matchers';
@ -911,17 +905,4 @@ describe('TestBed', () => {
.toEqual(originalResolver);
});
});
onlyInIvy('Ivy module registration happens when NgModuleFactory is created')
.it('cleans up registered modules', async() => {
@NgModule({id: 'my_module'})
class MyModule {
}
expect(() => getModuleFactory('my_module')).toThrowError();
await TestBed.inject(Compiler).compileModuleAsync(MyModule);
expect(() => getModuleFactory('my_module')).not.toThrowError();
TestBed.resetTestingModule();
expect(() => getModuleFactory('my_module')).toThrowError();
});
});