-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Labels
feat: reportersIssues and PRs related to Vitest reportersIssues and PRs related to Vitest reportersp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Vitest 3.1.4 runs all tests when using npm run test or --silent instead of limiting to the matching file.
After upgrading from [email protected] to [email protected]:
when running a test using a file name as a pattern:
✅ npx vitest success-reset-password-page correctly runs only that test file
❌ npm run test success-reset-password-page runs all tests, even though the pattern is passed
❌ npx vitest --silent success-reset-password-page also runs all tests
This worked correctly in 2.1.8, but is broken in 3.1.4.
Reproduction
"test": "vitest --silent"
"@pinia/testing": "^1.0.1",
"@quasar/quasar-app-extension-testing-unit-vitest": "^1.2.3",
"@vitest/coverage-v8": "^3.1.4",
"@vue/test-utils": "^2.4.6",
"vitest": "^3.1.4",import { fileURLToPath } from "node:url";
import { mergeConfig, defineConfig, configDefaults } from "vitest/config";
import viteConfig from "./vite.config";
export default mergeConfig(
viteConfig,
defineConfig({
test: {
globals: true,
environment: "jsdom",
exclude: [...configDefaults.exclude, "e2e/*"],
root: fileURLToPath(new URL("./", import.meta.url)),
coverage: {
provider: "v8",
exclude: [
...(configDefaults.coverage?.exclude || []),
"server.js",
"middleware/**",
"vue.config.js",
"src/main.ts",
],
},
},
})
);System Info
System:
OS: Windows 11 10.0.26100
CPU: (4) x64 Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz
Memory: 8.27 GB / 15.91 GB
Binaries:
Node: 20.18.1 - C:\Program Files\nodejs\node.EXE
npm: 11.3.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (131.0.2903.146)
npmPackages:
@vitejs/plugin-vue: ^5.2.4 => 5.2.4
@vitest/coverage-v8: ^3.1.4 => 3.1.4
vite: ^6.3.5 => 6.3.5
vitest: ^3.1.4 => 3.1.4Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
feat: reportersIssues and PRs related to Vitest reportersIssues and PRs related to Vitest reportersp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)


