From 1b4986d1aa036a2cee2ff949ef3608895e839f56 Mon Sep 17 00:00:00 2001 From: "Bonaventure C. J. Ugwu" <73999585+BonaventureCJ@users.noreply.github.com> Date: Tue, 2 Jun 2026 08:19:13 +0100 Subject: [PATCH 1/3] docs: clarify placeholder usage (#10496) --- guide/learn/writing-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/learn/writing-tests.md b/guide/learn/writing-tests.md index a047001b..35be6bb3 100644 --- a/guide/learn/writing-tests.md +++ b/guide/learn/writing-tests.md @@ -176,7 +176,7 @@ test.for([ }) ``` -The placeholders `%i`, `%s`, and `%f` in the test name are replaced with the corresponding values from each row, so the output shows `add(1, 1) -> 2`, `add(1, 2) -> 3`, and so on. +In the example above, the %i placeholders are replaced with the integer values from each data row. Vitest also supports other placeholder types, such as %s for strings and %f for floating-point numbers. As a result, the test runner generates test names such as add(1, 1) -> 2, add(1, 2) -> 3, and add(2, 1) -> 3. If your cases have more than two or three values, passing objects is more readable. Use `$property` in the name to interpolate fields: From a405655a581196481bf6bae0a817f961cc7f0305 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 2 Jun 2026 23:42:50 +0900 Subject: [PATCH 2/3] fix!: don't lookup config file from ancestor directories (#10428) Co-authored-by: Codex Co-authored-by: Hiroshi Ogawa <4232207+hi-ogawa@users.noreply.github.com> --- config/index.md | 2 ++ guide/migration.md | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/config/index.md b/config/index.md index 3a477823..30a72215 100644 --- a/config/index.md +++ b/config/index.md @@ -10,6 +10,8 @@ If you are using Vite and have a `vite.config` file, Vitest will read it to matc - Pass `--config` option to CLI, e.g. `vitest --config ./path/to/vitest.config.ts` - Use `process.env.VITEST` or `mode` property on `defineConfig` (will be set to `test` if not overridden with `--mode`) to conditionally apply different configuration in `vite.config.ts`. Note that like any other environment variable, `VITEST` is also exposed on `import.meta.env` in your tests +When an explicit `--config` option is not provided, Vitest looks for `vitest.config.{ts,mts,cts,js,mjs,cjs}` first and `vite.config.{ts,mts,cts,js,mjs,cjs}` second in the project [`root`](/config/root). If no config file is found, Vitest will run without one. + To configure `vitest` itself, add `test` property in your Vite config. You'll also need to add a reference to Vitest types using a [triple slash command](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-) at the top of your config file, if you are importing `defineConfig` from `vite` itself. If you are not using `vite`, add `defineConfig` imported from `vitest/config` to your config file: diff --git a/guide/migration.md b/guide/migration.md index 4d8ebbe3..1bc18c24 100644 --- a/guide/migration.md +++ b/guide/migration.md @@ -125,6 +125,15 @@ await expect.element(banner).toMatchTextContent(/error/i) // [!code ++] await expect.element(banner).toHaveTextContent('Error!') ``` +### Config Files Are Not Looked Up From Parent Directories + +Vitest no longer searches parent directories for config files. If you previously relied on running `vitest` from a subdirectory while using a config file from a parent directory, pass the config explicitly and scope test discovery with `--dir`. For example, + +```bash +$ cd subdir && vitest # [!code --] +$ cd subdir && vitest --config ../vitest.config.ts # [!code ++] +``` + ## Migrating to Vitest 4.0 {#vitest-4} ::: warning Prerequisites From 78ee2995b40ef9f8e295c810946ab9b4e3690b6c Mon Sep 17 00:00:00 2001 From: Matt Bordas Date: Tue, 2 Jun 2026 11:44:04 -0400 Subject: [PATCH 3/3] docs(browser): re-word browser mode development status (#10509) --- guide/browser/why.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/browser/why.md b/guide/browser/why.md index 24e3d041..70ff8aab 100644 --- a/guide/browser/why.md +++ b/guide/browser/why.md @@ -23,9 +23,9 @@ To achieve the highest level of confidence in our tests, it's crucial to test in When using Vitest browser, it is important to consider the following drawbacks: -### Early Development +### Not a Drop-In Replacement -The browser mode feature of Vitest is still in its early stages of development. As such, it may not yet be fully optimized, and there may be some bugs or issues that have not yet been ironed out. It is recommended that users augment their Vitest browser experience with a standalone browser-side test runner like WebdriverIO, Cypress or Playwright. +The browser mode feature of Vitest does not completely replace standalone end-to-end test runners. It is recommended that users augment their Vitest browser experience with a standalone browser-side test runner like WebdriverIO, Cypress or Playwright. ### Longer Initialization