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.

tsconfig.editor.json breaks tests development (Cannot find name 'describe')

See original GitHub issue

Current Behavior

Create angular app with latst (14.1) Nx Open app.component.spec.ts

TS2593: Cannot find name ‘describe’. Do you need to install type definitions for a test runner? Try npm i --save-dev @types/jest or npm i --save-dev @types/mocha and then add ‘jest’ or ‘mocha’ to the types field in your tsconfig.

image

Expected Behavior

No error in webstorm or vscode

Steps to Reproduce

npx create-nx-workspace@latest with angular preset

Failure Logs

The reason for this error in tests is new tsconfig.editor.json which do not respect jest types

{
  "extends": "./tsconfig.json",
  "include": ["**/*.ts"],
  "compilerOptions": {
    "types": []
  }
}

Environment

>  NX   Report complete - copy this into the issue template

  Node : 14.18.2
  OS   : win32 x64
  npm  : 6.14.15
  
  nx : 14.1.5
  @nrwl/angular : 14.1.5
  @nrwl/cypress : 14.1.5
  @nrwl/detox : Not Found
  @nrwl/devkit : 14.1.5
  @nrwl/eslint-plugin-nx : 14.1.5
  @nrwl/express : Not Found
  @nrwl/jest : 14.1.5
  @nrwl/js : Not Found
  @nrwl/linter : 14.1.5
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/nx-cloud : Not Found
  @nrwl/nx-plugin : Not Found
  @nrwl/react : Not Found
  @nrwl/react-native : Not Found
  @nrwl/schematics : Not Found
  @nrwl/storybook : 14.1.5
  @nrwl/web : Not Found
  @nrwl/workspace : 14.1.5
  typescript : 4.6.4
  rxjs : 7.4.0
  ---------------------------------------
  Community plugins:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
cnpallarescommented, Aug 30, 2022

Hey guys, a question regarding this topic…

What is tsconfig.editor.json for?

Thanks in advance 😃

0reactions
cnpallarescommented, Sep 15, 2022

@kwiniarski97 thank you!

I will take a look.

🙌🏽

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find name 'describe' Error in TypeScript | bobbyhadz
To solve the "Cannot find name 'describe'" error, install the type definitions ... typings for the package in the `types` array in your...
Read more >
How to Fix the “Cannot Find name 'describe'” Error in TypeScript
To fix the “cannot find name 'describe'” error, install the type definitions for your testing framework, and then add the definitions to the ......
Read more >
Angular 2 Unit Tests: Cannot find name 'describe'
Unit Tests work like a charm. The problem is: I see some errors, which are mentioned in tutorial: Our editor and the compiler...
Read more >
cannot find name 'describe'. do you need to install type ...
I'm using Visual Studio Code as my IDE and in my Angular project, and I had to comment-out/remove types in file tsconfig.json and...
Read more >
TSConfig Reference - Docs on every TSConfig option
An error occurs if any of the files can't be found. ... These filenames are resolved relative to the directory containing the tsconfig.json...
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