Open
Description
Environment
vscode-jest version
: v4.6.0node -v
: node 16+npm -v
oryarn --version
: 1.xnpm ls jest
ornpm ls react-scripts
(if you haven’t ejected):- your vscode-jest settings if customized: no
- jest.jestCommandLine?
- jest.autoRun?
- anything else that you think might be relevant?
- Operating system: Mac OS 13.0.x
Prerequisite
- are you able to run jest test from the command line? Yes
- how do you run your tests from the command line? (for example:
npm run test
ornode_modules/.bin/jest
)yarn test
Steps to Reproduce
jest.mock('./foo/bar.js', () => ({
foo: false,
bar: true,
}));
Relevant Debug Info
In order to improve the quality of developer of using jest in vscode, when trying to mock a module from relative path, it doesn't work like regular imported path, where there is no
- auto-suggestion for possible import
- file path being highlighted as hyperlink to provide convenient lookup
- refactoring on update import on file move simply will break the path
Expected Behavior
- The detection of reference path that allows hyperlink to actual file similar to how
import
works - Allow
updateImportsOnFileMove
when moving files
Actual Behavior
- It's a regular string where the file might not exist
- Refactoring causing spec failures
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...