node -v: v10.15.1npm -v: 6.4.1npm ls jest or npm ls react-scripts (if you haven鈥檛 ejected): [email protected]your vscode-jest settings if customized:
ClientAppOperating system: Windows 10 Pro (10.0.17134)
npm run test or node_modules/.bin/jest) npm run test:watchdotnet new reactreduxdotnet restore on the root directory (optional)cd ClientApp and npm install to install dependenciesRunning on console finds ClientApp/src/tests/App.test.tsx while it appears that the same command from the same location in this extension does not.
Command run in Powershell (npm run test:watch):
> [email protected] test C:\Users\menachem\source\repos\project\ClientApp
> react-scripts test --env=jsdom
Command output in Jest
> [email protected] test c:\Users\menachem\source\repos\project\ClientApp
> react-scripts test --env=jsdom "C:\Users\menachem\AppData\Local\Temp/jest_runner.json"
No tests found
In c:\Users\menachem\source\repos\project\ClientApp
15 files checked.
testMatch: c:\Users\menachem\source\repos\project\ClientApp\src\**\__tests__\**\*.{js,jsx,ts,tsx},c:\Users\menachem\source\repos\project\ClientApp\src\**\?(*.)(spec|test).{js,jsx,ts,tsx} - 1 match
testPathIgnorePatterns: \\node_modules\\ - 15 matches
Pattern: C:\Users\menachem\AppData\Local\Temp\\jest_runner.json - 0 matches
npm
ERR! Test failed. See above for more details.
Finished running all tests. Starting watch mode.
This repeats a few times until the extension stops.
Tests should be found (as they are on the command line) and run accordingly.
Tests are not found causing extension to fail.
Resolved by adding -- to the configuration as per @guylando in #342
Specifically "jest.pathToJest": "npm run test:watch", to "jest.pathToJest": "npm run test:watch --", in .vscode/settings.json
Most helpful comment
Resolved by adding -- to the configuration as per @guylando in #342
Specifically
"jest.pathToJest": "npm run test:watch",to"jest.pathToJest": "npm run test:watch --",in.vscode/settings.json