-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
VueCLI forces Jest's testMatch option #1067
Comments
It appears that the plugin always sets the testMatch to |
Just want to add that besides |
What makes this slightly worse is that the forced option isn't even a superset of Jests own default. For example, when testing with other Vue applications I've always just suppled a For example, I tend to use something like:
With Vue CLI, this doesn't work at all, which I'd consider a regression. Is there any technical reason to force override Jests own default? |
I think it's easier to just remove that code from the cli runtime and move it to the config generated by the cli |
That sounds like a sensible solution to me 😇 |
With my current PR (#1069) that is what I ended up doing. I moved the testMatch pattern over to the generator so that it goes into the package.json or jest.config.js (depending on how the user wants their config files laid out) |
Much better solution @dhensche ! 🤘 |
Thank you @dhensche 👍 |
Version
3.0.0-beta.6
Reproduction link
https://github.com/Ldoppea/vue-cli-jest-testmatch
Steps to reproduce
Init project with following options :
Move
/tests/unit/HelloWorld.spec.js
in/src/components/
Add
testMatch
in package.json Jest category :Run
npm run test
What is expected?
HelloWorld.spec.js should be tested
What is actually happening?
No test is found by Jest.
Get the following error :
testMatch still has the value forced by vueCLI
I was able to run my tests from
src
folder and without usingtestMatch
on vueCLI@3.0.0-beta.4. This commit changed the test detection behavior : 2c61d23#diff-17aae08cfc13cba07661681220ddd985 (I do not use typescript)The text was updated successfully, but these errors were encountered: