vscode-jest
vscode-jest copied to clipboard
command 'io.orta.jest.coverage.toggle' not found
Environment
node -v: [9.5.0]npm -v: [yarn 1.3.2]
Using version 2.6.0 of the extension.
- Operating system: [linux]
Steps to Reproduce
Try to toggle code coverage overlay
Expected Behavior
Should show overlay
Actual Behavior
Gives error command 'io.orta.jest.coverage.toggle' not found
Can you please provide more details, a repo to reproduce the issue, and how you've started the extension.
So it looks like it happens if I use the "Jest Toggle Coverage Overlay" command before doing the "Jest Start Runner" command. It should do it for you in that case.
But when I do Start Runner, I get an error "This extension relies on Jest 20+ features, it will continue to work, but some features may not work correctly." even though I have Jest 22 installed. pathToTest is set to the default which is where my jest executable is. In what cases do I need to set rootPath?
command 'io.orta.jest.restart' not found when using Yarn v2 /w PnP
pathToJest: "yarn jest"
Do you have any more information about how to reproduce the issue @koistya? The command is registered when the extension is activated in https://github.com/jest-community/vscode-jest/blob/master/src/extension.ts#L29. How did you get it to break?
@seanpoulter I'm seeing the same thing; I can manually start the runner with "Jest: Start Runner" but I get the "not found" message if I use "Jest: Restart Runner".
Similar to @koistya I'm using yarn v2 with PNP and pathToJest: "yarn jest", if that helps at all. I also have Jest configured through package.json rather than in its own config file, which means it doesn't start automatically.
(In any case, I don't think this is the same as the coverage issue; should probably be its own bug.)
i preformed the following: uninstalled jest, installed jest in WSL. toggling coverage and the setup extension beta option result in errors such as this:

since this project has no jest settings in settings.json i added a simple jest.rootPath to the parent which contains the jest.config.js file. the above errors continued to repete.
i then tried jest: start all runners and the hour glass icon popped up in the left hand extensions set. it reports 2/2 tests pass. toggle coverage started working.
For anyone coming to this, what helped me was to first run the Jest: Start all runners from the command palette and if needed reload VSCode.
i do highly recommend jest runner extension instead, its options in the context menu are super powerful and works perfectly for monorepos.
you need to set https://code.visualstudio.com/docs/editor/workspaces for jest extension if you are working with monorepos or a jest.config if is a single project/repo
this is a pretty old issue. In any case these "command: 'io.orta.jest.xxx'" not found is usually dut to this extension is not activated. With v5.0.0 the activation should not be an issue any more.