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 @@ -124,8 +124,14 @@ export async function* execute(
124
124
loadContent : async ( ) => {
125
125
const contents : string [ ] = [
126
126
// Initialize the Angular testing environment
127
- `import { getTestBed } from '@angular/core/testing';` ,
127
+ `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';` ,
128
128
`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
+ '' ,
129
135
`getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {` ,
130
136
` errorOnUnknownElements: true,` ,
131
137
` errorOnUnknownProperties: true,` ,
You can’t perform that action at this time.
0 commit comments