jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.83k stars 290 forks source link

Watch mode doesn't detect changes with `jest.rootPath` and `jest.pathToJest` set #419

Open deblasis opened 5 years ago

deblasis commented 5 years ago

Hi there, first of all thank you for this!

I found this issue. Happy to help unless you guys can find the root-cause in 15 seconds of if there's a painless workaround 😄

Environment

  1. node -v: v10.15.0

  2. npm -v: 6.5.0

  3. npm ls jest or npm ls react-scripts (if you haven’t ejected): jest@23.6.0

  4. your vscode-jest settings if customized:

    • jest.pathToJest? npm test --
    • jest.pathToConfig? not set
    • anything else that you think might be relevant? "jest.rootPath":"client/ui" also setting jest.pathToJest to npm test . -- works apparently, but it disables the jest smart git check for changes I reckon
  5. Operating system: Windows 10 + WSL (Ubuntu)

Prerequisite

Steps to Reproduce

Relevant Debug Info

if I set

jest.pathToJest": "npm test . --"

the watcher picks up the change (not sure about the impact down the line though)

Expected Behavior

The watcher should detect the change even if the web project is in a subfolder, set via jest.rootPath

Actual Behavior

After the first run, changes are not detected


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...

MakhouT commented 5 years ago

I am having the same issue. Also using a subDirectory 'client' Any solutions for this? I also tried it by prepending on it @deblasis where you able to fix it?

Hussain-Ruhullah commented 5 years ago

wrong= jest.pathToJest": "npm test . --", there is no ( . ) in => jest.pathToJest": "npm test --"