Vscode-jest: Setting up in a nested directory

Created on 10 May 2018  路  3Comments  路  Source: jest-community/vscode-jest

Environment

  1. node -v: [8.11.1]
  2. npm -v: [5.6]
  3. npm ls react-scripts (if you haven鈥檛 ejected): [1.1.4]
  4. Operating system: [Ubuntu 18.04]

Here is my project structure:

root
|- frontend
|- backend
|- .vscode

Can I configure the extension in some way that the jest runner can figure out where the npm scripts and binary is?
I'm using create-react-app
I tried settings up "jest.pathToJest": "frontend/node_modules/.bin/react-scripts test --env=jsdom" but it didn't help.

question workspace

Most helpful comment

Resolved it.
Here is the final setting:

{
  "jest.pathToJest": "npm test:unit --",
  "jest.rootPath": "frontend"
}

All 3 comments

Resolved it.
Here is the final setting:

{
  "jest.pathToJest": "npm test:unit --",
  "jest.rootPath": "frontend"
}

I'm on CRA 2.0 and I've done exactly like above - but unfortunately the extension does nothing for me 馃槙

Running the tests manually works well though.

I'm on CRA 2.0 and I've done exactly like above - but unfortunately the extension does nothing for me 馃槙

Running the tests manually works well though.

I have the same problem.

Was this page helpful?
0 / 5 - 0 ratings