You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/migration.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,44 @@ See also new guides:
71
71
-[Including and excluding files from coverage report](/guide/coverage.html#including-and-excluding-files-from-coverage-report) for examples
72
72
-[Profiling Test Performance | Code coverage](/guide/profiling-test-performance.html#code-coverage) for tips about debugging coverage generation
73
73
74
+
### Simplified `exclude`
75
+
76
+
By default, Vitest now only excludes tests from `node_modules` and `.git` folders. This means that Vitest no longer excludes:
77
+
78
+
-`dist` and `cypress` folders
79
+
-`.idea`, `.cache`, `.output`, `.temp` folders
80
+
- config files like `rollup.config.js`, `prettier.config.js`, `ava.config.js` and so on
81
+
82
+
If you need to limit the directory where your tests files are located, use the [`test.dir`](/config/dir) option instead because it is more performant than excluding files:
Previously, if you tried to spy on a constructor with `vi.spyOn`, you would get an error like `Constructor <name> requires 'new'`. Since Vitest 4, all mocks called with a `new` keyword construct the instance instead of calling `mock.apply`. This means that the mock implementation has to use either the `function` or the `class` keyword in these cases:
0 commit comments