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.

Tests not working anymore after updating to version < 24.0.0

See original GitHub issue

💥 Regression Report

Today, we’ve updated to the newest version of jest in our TypeScript project. We’ve included jest in our package.json of our project with "jest": "^24.7.1". We’ve also included "jest-when": "^2.4.0".

When we run now our tests, we get 1531 errors that jest wasn’t found:

  • Cannot find name 'jest'.
  • Cannot find name 'expect'.
  • Cannot find name 'it'. Do you need to install type definitions for a test runner? Try npm i @types/jestornpm i @types/mocha and then addjestormocha to the types field in your tsconfig.

and much more.

We include jest in our spec’s with import 'jest'; at the top.

Does anyone has an idea what could be the problem?

Steps to reproduce the behavior:

Expected behavior

The tests should run successfully.

Run npx envinfo --preset jest

Paste the results here:

System:
    OS: macOS 10.14.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 11.10.1 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.7.0 - /usr/local/bin/npm
  npmPackages:
    jest: ^24.7.1 => 24.7.1 

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
siyahatamicommented, Sep 2, 2020

for me this is solved just by adding following line to file: import '@types/jest';

4reactions
srmaguracommented, Oct 30, 2019

Installing @types/jasmine did not work for me. @ljsimintt’s suggestion worked, though I eventually settled on pinning jest and @types/jest to 24.0.0 so I could stay on the same major version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests not working anymore after updating to version < 24.0.0
Today, we've updated to the newest version of jest in our TypeScript project. We've included jest in our package.json of our project with ......
Read more >
Index of /archive/24.0.0/dev/ag-grid-community/dist/lib/style-tests
Index of /archive/24.0.0/dev/ag-grid-community/dist/lib/style-tests. Parent Directory · ag-theme-params.test.d.ts.
Read more >
Changelog - Cypress Documentation
Sessions will no longer be stored if validation fails which will prevent a previously failed session from being restored in the next test....
Read more >
Current Series Release Notes — tempest documentation
Add a new client to lists, creates, shows information for, and updates neutron log resource. Upgrade Notes¶. Tempest's identity service client ...
Read more >
Fixed issues in Photoshop - Adobe Support
December 2022 (version 4.2) release. This month's update brings enhancements and fixes for some customer-reported issues. More like this.
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