-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Syntax Error Output when running jest --coverage --watch
on Jest 23
#6258
Comments
Mind setting up a repro please? |
Yeah let me just scrub a 20k loc repo and share. It how do I go about that? I thought the configs would be what's needed since that's all the interface I have into Jest. |
Yup, but I'd need to do all the manual work, which I don't feel like. The easier you'll make your bug report to process for maintainers, the more likely it will get fixed :) |
The instructions for how to even go about making a repro are unclear. Do you have example repos you can link to? I assume you have a test suite and fixtures. Linking to those would give people resources to even create a repro. |
Ideally, a repro is a git repository where we can checkout, run |
It needs to be as simple as possible, so we can focus on actual bug. |
I'll try making the repo. Cool, I think I found the problem, because I'm using projects having the coverage configurations within This is fine, but it wasn't a breaking thing for Jest 22. 🤷♂️ |
I think I was able to successfully reproduce the error in #6859. |
Having this as well, but I have my jest configuration into my
Versions:
Throws:
|
@damianobarbati Does the status of the staging area matter, to produce this error? Are there any changes that are both unstaged and uncommitted? And what command are you running, |
@garyking yes! I just committed everything and the error disappeared: is this a known behaviour? I'm using jest like this: |
@damianobarbati I reported my own findings at #6859. It isn't "known behavior", in that a Jest contributor hasn't responded to my other issue yet. They've acknowledged the issue here, but there hadn't otherwise been any other activity on it since May. I personally encounter this issue about once a day. It seems to happen when you have a non-.js file that has uncommitted changes, and you have |
I was seeing the same issue, explicitly adding json files to be ignore was not helping. Committing the changes fixed it indeed for me. Thank you! This was driving me crazy. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Somehow the coverage generator is trying to parse the package.json and outputs this error.
To Reproduce
Steps to reproduce the behavior:
This may be affected by my usage of projects. I have the following configs.
So I assume that when I run
yarn test --watch
which isjest --coverage
it would run with thejest.config.js
as its configuration.Expected behavior
I would expect the coverage output to appear as normal and not produce a syntax error.
Link to repl or repo (highly encouraged)
Please provide either a repl.it demo or a
minimal repository on GitHub.
Issues without a reproduction link are likely to stall.
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: