Example project's tests can't be run with intellij
See original GitHub issueDescribe the bug
I cloned the examples folder of the jest builder and tried to run the multiple-apps
example directly from intellij and it didn’t work. The first app (my-first-app
) runs correctly. The second one (my-second-app
) uses a testMatch
option which searches test files in my-first-app
and when running my-shared-library
tests the rootDir is set to the lib root.
Running the tests via ng test <project-name>
from a terminal works fine, however.
This could be either a configuration issue within the example app or with intellij passing the wrong parameters. Maybe @segrey can have a look at the intellij side.
To Reproduce Steps to reproduce the behavior:
- Clone and open the multiple-apps example with intellij
- Do an npm or yarn install
- Execute a test case in each of the three projects directly from intellij (the little play button)
Expected behavior Each test case should be executable within intellij
Builder:
- jest-builder
- v7.2.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Run tests | IntelliJ IDEA Documentation - JetBrains
To run all tests in a folder, select this folder in the Project tool window and press Ctrl+Shift+F10 or select Run Tests in...
Read more >Example project's tests can't be run with intellij #203 - GitHub
Running the tests via ng test <project-name> from a terminal works fine, however. This could be either a configuration issue within the example...
Read more >Running tests on Intellij: Class not found - Stack Overflow
Worked for me. My project has sub maven modules and instead of creating 1 rootmodule.iml it created an iml file for each sub...
Read more >IntelliJ Plugin - Kotest
The Intellij plugin requires Kotest 4.2 or higher and will not run common tests of a multiplatform ... For example, you can quickly...
Read more >Unit Testing and Coverage in IntelliJ IDEA - YouTube
Find out how to: - Create test classes and test methods - Run and re- run tests - Debug code - Measure test...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I got this. I was under the wrong impression that the problem is with IntelliJ specifying the wrong working directory. But in fact, if we look at the error it’s clear that the problem is that Jest cannot find the
jest-preset-angular/preprocessor.js
file.This is because it’s looking at
<rootDir>/node_modules/jest-preset-angular/preprocessor.js
which, in turn, comes from the preset configuration itself.So it seems that the right way to go is if jest-builder was overriding this path with the
${workspaceRoot}/node_modules/...
. This would allow Jest to find the preprocessor disregarding the<rootDir>
. Will fix that.Fixed in
7.2.3