Run jest within intellij
See original GitHub issuePrerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
- I am running the latest version
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
- I’m reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)
I am not sure if this is an Nx related issue. I am using another builder (https://www.npmjs.com/package/@angular-builders/jest) in a diferent project where everything works fine, though.
Expected Behavior
When creating a fresh Nx workspace with angular and jest I expect to be able to run any jest test from within intellij IDEA (I use the ultimate edition 2019.2).
Current Behavior
An exception occurs:
An unhandled exception occurred: reporters.find is not a function
See "/private/var/folders/dn/6yw0_6l52pb_zsjqss035h1h0000gn/T/ng-TfsdqI/angular-errors.log" for further details.
Logfile content:
[error] TypeError: reporters.find is not a function
at TestScheduler._shouldAddDefaultReporters (/Users/sroettering/git/jest-intellij-demo/node_modules/@jest/core/build/TestScheduler.js:411:19)
at TestScheduler._setupReporters (/Users/sroettering/git/jest-intellij-demo/node_modules/@jest/core/build/TestScheduler.js:423:28)
at new TestScheduler (/Users/sroettering/git/jest-intellij-demo/node_modules/@jest/core/build/TestScheduler.js:194:10)
at /Users/sroettering/git/jest-intellij-demo/node_modules/@jest/core/build/runJest.js:412:29
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/sroettering/git/jest-intellij-demo/node_modules/@jest/core/build/runJest.js:148:24)
at _next (/Users/sroettering/git/jest-intellij-demo/node_modules/@jest/core/build/runJest.js:168:9)
at processTicksAndRejections (internal/process/task_queues.js:89:5)
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
- clone https://github.com/sroettering/jest-intellij-demo which contains a fresh nx workspace with angular and jest
- open the project with intellij IDEA
- Edit the jest run configuration template to use @angular/cli as jest package
- open any .spec.ts file and try to run a test by clicking on the play button to the left (or press ctrl + shift + r)
Context
Please provide any relevant information about your setup:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Run/Debug Configuration: Jest | IntelliJ IDEA Documentation
Click the Browse button in the Suite name field and configure a list of suites to run using the Add and Remove buttons....
Read more >Run Jest test in IntelliJ IDEA - Stack Overflow
Now I am attempting to run the generated test in IntelliJ as well. I get the following output when I do so: /usr/bin/node...
Read more >Run/Debug Configuration: Jest - Help | IntelliJ IDEA - JetBrains
Test: choose this option to run individual tests from a test file and specify the path to this file in the Test file...
Read more >IntelliJ IDEA vs Jest | What are the differences? - StackShare
IntelliJ IDEA and Jest are primarily classified as "Integrated Development ... are mocked and tests run in parallel via a small node.js command...
Read more >[Solved]-Running jest tests directly in Intellij Idea/WebStorm?
[Solved]-Running jest tests directly in Intellij Idea/WebStorm?-Reactjs · Install Jest CLI: npm install --save-dev jest-cli · Create node run configuration with ...
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 Free
Top 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
Well then I hope @dopsonbr resolves the conflicts soon.
I already opened PR #1657 which basically resolves the conflicts from #1467 and fixes the tests.