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.

jest.Global incorrectly extends interface 'NodeJS.Global'?

See original GitHub issue

Hello dear Jest fellows, i’ve been doing some maintenance stuff in stryker-mutator and came into this error:

packages/jest-runner/node_modules/@jest/types/build/Global.d.ts:54:18 - error TS2430: Interface 'import("/home/travis/build/stryker-mutator/stryker/packages/jest-runner/node_modules/@jest/types/build/Global").Global' incorrectly extends interface 'NodeJS.Global'.
  Types of property 'describe' are incompatible.
    Type 'Describe' is not assignable to type 'SuiteFunction'.
      Types of property 'only' are incompatible.
        Type 'DescribeBase' is not assignable to type 'ExclusiveSuiteFunction'.
          Type 'void' is not assignable to type 'Suite'.
54 export interface Global extends NodeJS.Global {

We don’t get any other error related to that so I am not sure why is it occurring (all i have done is to change dependencies from jest: ^24.9.0 to ~24.9)

Do you have any idea why it happened?

link to a PR: https://github.com/stryker-mutator/stryker/pull/1706 link to a one of travis jobs: https://travis-ci.org/stryker-mutator/stryker/jobs/582083380

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
codevikingcommented, Feb 4, 2020

We ran into this recently. Ultimately it was because:

Our solution was to replace expect with chai, as it doesn’t depend upon @jest. We could’ve also likely replaced mocha with jest, but that felt like a larger effort.

1reaction
drudvcommented, Nov 22, 2019

I had a similar issue because there was another node_modules folder on top of my project’s folder. The errors disappeared, when I removed those node_modules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Interface 'JestImportMeta' incorrectly extends ...
This error occurs when trying to compile using tsc . Related packages in my package.json: "devDependencies": { "@types/jest" ...
Read more >
Configuring Jest
useFakeTimers() in each test file, you can enable fake timers globally for all tests in your Jest configuration: JavaScript; TypeScript. /** @ ...
Read more >
Jest — How to Use Extend with TypeScript | by Moon
If you want to toss some parameters to toBeOdd , then the configurations should be like below. // index.d.ts declare global { ......
Read more >
Extend the Node.js Global (globalThis) object in TypeScript
Copied! /* eslint-disable no-var */ interface Employee { name: string; age: number; } declare global { var myObj: Employee; function sum(a: number, b:...
Read more >
Node.js v19.3.0 Documentation
node :buffer module APIs ... Native abstractions for Node.js; Node-API; Addon examples ... readSync legacy String interface; DEP0016: GLOBAL / root ...
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