Jest runner doesn't recognise tests
Version: Webstorm 2019.1.1
Build Version: WS-191.6707.60
Operating system: Ubuntu Linux
I've been reconfiguring my project to run using yarn workspaces; as such, my jest config is in one directory (`packages/core/config`), with every package extending the core jest config.
Tests within the directory `packages/core/src*` all show as tests; when I run them, the Jest test runner starts. However, tests in other directories do not, and instead are run using `node`.
Has anybody encountered this problem before? Here's a link to a project with the same issue: https://github.com/LewisDaleUK/WeddingPlanner
Please sign in to leave a comment.
The logic currently used for detecting what test runner is available for a given test file is based on dependencies declarations in
package.jsonnearest to this file, so, itjestis not listed there, there is no way to run tests from the gutter.jestis not listed as a dependency in packages/components/package.json, so the files from packages/components/ don't have this test runner attachedThis will be changed in the next minor update (2019.1.2) - see
https://youtrack.jetbrains.com/issue/WEB-35160#focus=streamItem-27-3252756.0-0
Ah, that makes sense. Thanks for the response; so I'll need to have jest as a dependency for each package until the update?
EDIT: Just added jest as a dependency in the root package.json, and that seems to have done the trick. Thanks for the help Elena.
yes, as a dependency or devDependency