Skip to content

forceRerunTriggers

  • Type: string[]
  • Default: ['**/package.json/**', '**/vitest.config.*/**', '**/vite.config.*/**']

Glob pattern of file paths that will trigger the whole suite rerun. When paired with the --changed argument will run the whole test suite if the trigger is found in the git diff.

Useful if you are testing calling CLI commands, because Vite cannot construct a module graph:

ts
test('execute a script', async () => {
  // Vitest cannot rerun this test, if content of `dist/index.js` changes
  await execa('node', ['dist/index.js'])
})

TIP

Make sure that your files are not excluded by server.watch.ignored.

Released under the MIT License.