Skip to content

Instantly share code, notes, and snippets.

@topnotch48
Created April 22, 2018 13:58
Show Gist options
  • Save topnotch48/10d35fb4483fb314952ed323cdda80ff to your computer and use it in GitHub Desktop.
Save topnotch48/10d35fb4483fb314952ed323cdda80ff to your computer and use it in GitHub Desktop.
resetTestingModule() {
clearOverrides();
this._aotSummaries = [];
this._templateOverrides = [];
this._compiler = null !;
this._moduleOverrides = [];
this._componentOverrides = [];
this._directiveOverrides = [];
this._pipeOverrides = [];
this._isRoot = true;
this._rootProviderOverrides = [];
this._moduleRef = null !;
this._moduleFactory = null !;
this._compilerOptions = [];
this._providers = [];
this._declarations = [];
this._imports = [];
this._schemas = [];
this._instantiated = false;
this._activeFixtures.forEach((fixture) => {
try {
fixture.destroy();
} catch (e) {
console.error('Error during cleanup of component', {
component: fixture.componentInstance,
stacktrace: e,
});
}
});
this._activeFixtures = [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment