node -v: [v8.11.2]npm -v: [6.1.0]npm ls react-scripts (if you haven’t ejected): [[email protected] /Users/jnorton1/Node.js/jtest_test
└── (empty)]
Operating system: [macOS 10.12.6]
Create a simple node project with npm -init and add jest as a dependency using yarn add --dev jest. Then create a simple source file and test file following the jest "getting started" instructions https://jestjs.io/docs/en/getting-started. Verify from command line that jest works by running yarn test in the project directory.
Open VS Code in the project directory and open test file. Expect to see solid green circle next to test indicating test has run.
See unfilled green circle indicating test has not been run. Hovering over circle gives this message:
"Test has not run yet, due to Jest only running tests related to changes.". Attempting to change code of called function does not run test. Attempting to force jest startup using Jest: Start Runner from command palette has no effect.
Update: Running 'Jest: Show Test Output Channel' indicates that jest _is_ running, but for some reason the UI is not updating. I also noticed when I restarted that there is now a warning message that the extension requires features of jest 20+ and some things may not work correctly. 'jest -version' prints 23.4.0, however, so I'm not sure why the extension is complaining, unless it is using a different jest installation. I have set "jest.pathToJest": "/usr/local/bin/jest" in my prefs, so I don't see that happening.
I did try to install jest globally and add the pasToJest options point to my global node modules but the UI is still not update on my side
To run the actual function it's just
"Jest Start Runner"
Someone messed up on the commands...
I do have the logs
"Finished running all tests. Starting watch mode."
(Automatically our by running "jest start runner"), but still no update on the UI.
the current vscode-jest has a compatibility issue with jest 23.x (jest/#6586). We hope to release PR #341 as soon as possible to address this issue... until then, you can try downgrading to jest 22.x.
vscode-jest 2.9.0 has shipped with jest 23.x support and more, which should address this issue. Feel free to reopen if otherwise.
Most helpful comment
the current vscode-jest has a compatibility issue with jest 23.x (jest/#6586). We hope to release PR #341 as soon as possible to address this issue... until then, you can try downgrading to jest 22.x.