Skip to content

Commit 80e5865

Browse files
committed
fix(@angular/build): provide vitest globals in unit-test builder
The experimental `unit-test` builder with the `vitest` runner now provides the test APIs also as globals. This increases the potential compatibility for existing karma/jasmine based tests. The initial unit tests within a newly generated application, for instance, now require no changes to execute with the new builder.
1 parent bd18065 commit 80e5865

File tree

1 file changed

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

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export async function* execute(
223223
instance ??= await startVitest('test', undefined /* cliFilters */, undefined /* options */, {
224224
test: {
225225
root: outputPath,
226+
globals: true,
226227
setupFiles,
227228
// Use `jsdom` if no browsers are explicitly configured.
228229
// `node` is effectively no "environment" and the default.

0 commit comments

Comments
 (0)