Closed mahy-ks-hussain closed 2 weeks ago
Hi @mahy-ks-hussain, thanks for providing the repo. I tried running it, and the tests worked fine on my end (though the tests in the lasagna
package failed, all tests in hello-world
passed). This suggests the issue might be related to your shell environment setup.
If you can run tests via the CLI (is it npm test
?) but get an npm not found
error with the extension, this indicates the extension's spawned shell doesn't have the correct environment setup—specifically, the PATH to npm
may be missing. This link explains the issue in detail and provides potential solutions, which might help you resolve it.
I also noticed that the test
scripts in both package.json
files are defined as "test": "jest ./*"
. Since Jest will automatically find and run all test files based on the patterns in the Jest config, you don’t need to include ./*
.
Let me know if you’re still having issues.
Thanks so much @connectdotz! This actually cleared up a lot for me. I'll also keep that in mind about the test files (which I didn't write, but are written by the team who makes these practice exercises).
Describe the bug I am able to run tests from the CLI, and despite the output saying
[error] failed to retrieve test file list. TestExplorer might show incomplete test items
, I can still see the tests in the Test Explorer. However, I'm not able to run any of the tests, and I'm not sure what's going wrong in my config. Also, the testing button in the toolbar (flask) doesn't show up on startup until I run any Jest command.My folder/workspace structure is like this:
To Reproduce Steps to reproduce the behavior:
Note: A sample repo will help us identify the bug much faster. 🙏 Affected repo: https://github.com/[mahy-ks-hussain/exercism_javascript](https://github.com/mahy-ks-hussain/exercism_javascript)
Expected behavior I am expecting the tests to be able to run similar to how it is in the CLI.
Screenshots
Environment (please complete the following information):
node -v
: 22.11.0npm -v
oryarn --version
: np 10.9.0Prerequisite
Additional context I am still very, very new to JavaScript and its environment setup, and this is my first time trying it out.