Skip to content

Commit 1d26eb5

Browse files
committed
fix(@angular/build): use global unit-test hooks during TestBed init
To provide improved Zone.js support with the experimental `unit-test` builder using the `vitest` runner, the TestBed initialization now uses the global `beforeEach`/`afterEach` test hooks. The global hooks can be patched by Zone.js. The vitest globals are always available when using the `unit-test` builder.
1 parent ce28407 commit 1d26eb5

File tree

1 file changed

+0
-1
lines changed
  • packages/angular/build/src/builders/unit-test

1 file changed

+0
-1
lines changed

packages/angular/build/src/builders/unit-test/builder.ts

-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export async function* execute(
145145
`import { NgModule } from '@angular/core';`,
146146
`import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';`,
147147
`import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`,
148-
`import { beforeEach, afterEach } from 'vitest';`,
149148
'',
150149
normalizedOptions.providersFile
151150
? `import providers from './${path

0 commit comments

Comments
 (0)