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 @@ -124,8 +124,14 @@ export async function* execute(
124124 loadContent : async ( ) => {
125125 const contents : string [ ] = [
126126 // Initialize the Angular testing environment
127- `import { getTestBed } from '@angular/core/testing';` ,
127+ `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';` ,
128128 `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';` ,
129+ `import { beforeEach, afterEach } from 'vitest';` ,
130+ '' ,
131+ // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29
132+ `beforeEach(getCleanupHook(false));` ,
133+ `afterEach(getCleanupHook(true));` ,
134+ '' ,
129135 `getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {` ,
130136 ` errorOnUnknownElements: true,` ,
131137 ` errorOnUnknownProperties: true,` ,
You can’t perform that action at this time.
0 commit comments