File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/angular/build/src/builders/unit-test Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -115,8 +115,14 @@ export async function* execute(
115115 loadContent : async ( ) => {
116116 const contents : string [ ] = [
117117 // Initialize the Angular testing environment
118- `import { getTestBed } from '@angular/core/testing';` ,
118+ `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';` ,
119119 `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';` ,
120+ `import { beforeEach, afterEach } from 'vitest';` ,
121+ '' ,
122+ // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29
123+ `beforeEach(getCleanupHook(false));` ,
124+ `afterEach(getCleanupHook(true));` ,
125+ '' ,
120126 `getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {` ,
121127 ` errorOnUnknownElements: true,` ,
122128 ` errorOnUnknownProperties: true,` ,
You can’t perform that action at this time.
0 commit comments