File tree 1 file changed +7
-1
lines changed
packages/angular/build/src/builders/unit-test
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(
115
115
loadContent : async ( ) => {
116
116
const contents : string [ ] = [
117
117
// Initialize the Angular testing environment
118
- `import { getTestBed } from '@angular/core/testing';` ,
118
+ `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';` ,
119
119
`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
+ '' ,
120
126
`getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {` ,
121
127
` errorOnUnknownElements: true,` ,
122
128
` errorOnUnknownProperties: true,` ,
You can’t perform that action at this time.
0 commit comments