question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run jest within intellij

See original GitHub issue

Prerequisites

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.

  1. clone https://github.com/sroettering/jest-intellij-demo which contains a fresh nx workspace with angular and jest
  2. open the project with intellij IDEA
  3. Edit the jest run configuration template to use @angular/cli as jest package image
  4. 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:

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sroetteringcommented, Jul 26, 2019

Well then I hope @dopsonbr resolves the conflicts soon.

1reaction
sroetteringcommented, Aug 5, 2019

I already opened PR #1657 which basically resolves the conflicts from #1467 and fixes the tests.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found