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.

naive-ui > seemly > @types/jest breaks typescript usage with mocha

See original GitHub issue

TuSimple/naive-ui version (版本)

2.31.0

Vue version (Vue 版本)

3.2.37

Browser and its version (浏览器及其版本)

any

System and its version (系统及其版本)

typescript@4.6.4

Node version (Node 版本)

node v14.19.0

Reappearance link (重现链接)

https://codesandbox.io/s/not-required

Reappearance steps (重现步骤)

build a typescript project with both naive-ui and @types/mocha installed

Expected results (期望的结果)

build successfully

Actual results (实际的结果)

node_modules/@types/mocha/index.d.ts:2725:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'test' must be of type 'It', but here has type 'TestFunction'.

2725 declare var test: Mocha.TestFunction;
                 ~~~~

  node_modules/@types/jest/index.d.ts:43:13
    43 declare var test: jest.It;
                   ~~~~
    'test' was also declared here.

...lots of similar errors omitted...

Remarks (补充说明)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
undefined-moecommented, Jul 10, 2022

works for me 😃

1reaction
07akionicommented, Jul 10, 2022

This issue is caused by package seemly in your dependencies, which included (by accident) @types/jest to their deps.

Possiable solutions are:

  • Notify the upstream to publish a patch version
  • Switch to another library

I’ve released seemly@0.3.5 to fix it. I think you can reinstall naive-ui (remove lock file first) to solve the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

naive-ui > seemly > @types/jest breaks typescript usage ...
Variable 'test' must be of type 'It', but here has type 'TestFunction'. 2725 declare var test: Mocha.TestFunction; ~~~~ node_modules/@types/jest ...
Read more >
How to use Mocha and Jest with TypeScript without conflicts?
I searched through package lock file to see which dependencies use @types/jest and found out that in my case I still have ts-jest...
Read more >
naive-ui - npm Package Health Analysis
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >
cannot find name 'test'. do you need to install type ...
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...
Read more >
naive-ui - bytemeta
naive-ui repo issues. ... naive-ui > seemly > @types/jest breaks typescript usage with mocha. Aaronxjs. Aaronxjs CLOSED · Updated 3 months ago ...
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