Skip to content

Commit 49b65ab

Browse files
committed
fix(@angular/build): disable Vitest test isolation by default
Disables test isolation in Vitest by setting `isolate: false` in the default Vitest configuration. This change aligns the default test isolation behavior with the existing Karma/Jasmine experience, promoting standardization across testing frameworks within the Angular CLI. This also provides significant performance improvements, especially in browser mode, by reducing the overhead associated with test isolation. All known issues related to disabling isolation have been addressed. (cherry picked from commit 4d42a3e)
1 parent 6b2a88a commit 49b65ab

File tree

1 file changed

+2
-1
lines changed
  • packages/angular/build/src/builders/unit-test/runners/vitest

1 file changed

+2
-1
lines changed

packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export async function createVitestConfigPlugin(
117117
test: {
118118
setupFiles,
119119
globals: true,
120-
// Allow Vitest to manage test isolation by its default behavior.
120+
// Default to `false` to align with the Karma/Jasmine experience.
121+
isolate: false,
121122
sequence: { setupFiles: 'list' },
122123
},
123124
optimizeDeps: {

0 commit comments

Comments
 (0)