Skip to content

Commit 7b8c9af

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 9d3071d commit 7b8c9af

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

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export async function* execute(
213213
instance ??= await startVitest('test', undefined /* cliFilters */, undefined /* options */, {
214214
test: {
215215
root: outputPath,
216+
globals: true,
216217
setupFiles,
217218
// Use `jsdom` if no browsers are explicitly configured.
218219
// `node` is effectively no "environment" and the default.

0 commit comments

Comments
 (0)