Closed jwalkerinterpres closed 5 months ago
However, despite the above
exclude
, tests in mye2e
andnode_modules
folders are run.
You have an error in you configuration. node_modules/*
excludes only files in the first level - https://www.digitalocean.com/community/tools/glob?comments=true&glob=node_modules%2F%2A&matches=false&tests=node_modules%2Fgraphiql%2Fsrc%2Fcomponents%2F__tests__%2FGraphiQL.spec.
When **, the "globstar", is used it matches zero or more directories and subdirectories. This allows for recursive directory searching easily.
Default pattern correctly excludes node_modules: https://vitest.dev/config/#exclude
['**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**', '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*']
Describe the bug
I have the following
test
section in myvite.config.ts
(the "exclude" section is the key part):However, despite the above
exclude
, tests in mye2e
andnode_modules
folders are run.Example Tests (from excluded folders):
Example failure (originating in
node_modules
)(There are lots more of the above.)
Clearly:
is not being applied.
Reproduction
Since this doesn't seem to have anything to do with my test files (the whole problem is that it's runing files besides mine), and I've provided my vite config, I'm not sure what else I can offer to help with reproduction, but I'd be happy to provide anything else.
System Info
Used Package Manager
npm
Validations