Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dir option is not respected with file addition detection #982

Closed
6 tasks done
sapphi-red opened this issue Mar 19, 2022 · 0 comments · Fixed by #1070
Closed
6 tasks done

dir option is not respected with file addition detection #982

sapphi-red opened this issue Mar 19, 2022 · 0 comments · Fixed by #1070

Comments

@sapphi-red
Copy link
Contributor

sapphi-red commented Mar 19, 2022

Describe the bug

When there is a config like below, test/foo.test.ts will not run. (This is correct.)
But if you add test/bar.test.ts after running vitest, it gets included.

export default defineConfig({
  test: {
    dir: 'src',
    include: ['**/*.test.ts'],
  },
});

Maybe related to #981.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-xrmrde?file=vite.config.ts&initialPath=__vitest__

  1. Run npm run test.
  2. See src/bar.test.ts is included and test/bar.test.ts is not included.
  3. Add test/foo.test.ts.
  4. Rerun will happen and test/foo.test.ts is included.

System Info

stackblitz

vitest 0.7.4

Used Package Manager

npm

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant