Skip to content

Cannot run Jest tests from Webstorm #2314

@boar-is

Description

@boar-is

Prerequisites

  • I am running the latest version
  • I checked the documentation (nx.dev) 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 React, Angular or any dependency)

Expected Behavior

I just want to run the tests from app.component.spec.ts from IntelliJ IDEA/WebStorm UI.

Current Behavior

I get an error.

Steps to Reproduce

  1. Generate a new workspace (Angular+Nest).
  2. Run any test (or all of them) from app.component.spec.ts with IntelliJ IDEA/WebStorm UI (Click on green triangle(s) near the line numbers).

Failure Logs

Error: Failed: "Zone is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/dist/zone.js"
Error: 
    at Env.beforeEach (E:\testing\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:41:24)
    at beforeEach (E:\testing\node_modules\jest-jasmine2\build\jasmine\jasmineLight.js:111:29)
    at Suite.Object.<anonymous>.describe (E:\testing\apps\client\src\app\app.component.spec.ts:7:3)
    at addSpecsToSuite (E:\testing\node_modules\jest-jasmine2\build\jasmine\Env.js:496:51)
    at Env.describe (E:\testing\node_modules\jest-jasmine2\build\jasmine\Env.js:466:11)
    at describe (E:\testing\node_modules\jest-jasmine2\build\jasmine\jasmineLight.js:81:18)
    at Object.<anonymous> (E:\testing\apps\client\src\app\app.component.spec.ts:6:1)
    at Runtime._execModule (E:\testing\node_modules\jest-runtime\build\index.js:867:68)
    at Runtime._loadModule (E:\testing\node_modules\jest-runtime\build\index.js:577:12)
    at Runtime.requireModule (E:\testing\node_modules\jest-runtime\build\index.js:433:10)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions