wu_trulli 2023-03-12 19:21 采纳率: 62.5%
浏览 48
已结题

ts文件转js时node_modules/@types/mocha/index.d.ts报错

我把一个ts文件转js时为什么node_modules/@types/mocha/index.d.ts文件会报错,这不是自带的标准文件吗?

node_modules/@types/mocha/index.d.ts:2650:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'beforeEach' must be of type 'Lifecycle', but here has type 'HookFunction'.

2650 declare var beforeEach: Mocha.HookFunction;
                 ~~~~~~~~~~

  node_modules/@types/jest/index.d.ts:34:13
    34 declare var beforeEach: jest.Lifecycle;
                   ~~~~~~~~~~
    'beforeEach' was also declared here.

node_modules/@types/mocha/index.d.ts:2668:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'afterEach' must be of type 'Lifecycle', but here has type 'HookFunction'.

2668 declare var afterEach: Mocha.HookFunction;
                 ~~~~~~~~~

  node_modules/@types/jest/index.d.ts:36:13
    36 declare var afterEach: jest.Lifecycle;
                   ~~~~~~~~~
    'afterEach' was also declared here.

node_modules/@types/mocha/index.d.ts:2684:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'describe' must be of type 'Describe', but here has type 'SuiteFunction'.

2684 declare var describe: Mocha.SuiteFunction;
                 ~~~~~~~~

  node_modules/@types/jest/index.d.ts:37:13
    37 declare var describe: jest.Describe;
                   ~~~~~~~~
    'describe' was also declared here.

node_modules/@types/mocha/index.d.ts:2705:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'xdescribe' must be of type 'Describe', but here has type 'PendingSuiteFunction'.

2705 declare var xdescribe: Mocha.PendingSuiteFunction;
                 ~~~~~~~~~

  node_modules/@types/jest/index.d.ts:39:13
    39 declare var xdescribe: jest.Describe;
                   ~~~~~~~~~
    'xdescribe' was also declared here.

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

2719 declare var it: Mocha.TestFunction;
                 ~~

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

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

2733 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.

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

2740 declare var xit: Mocha.PendingTestFunction;
                 ~~~

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


Found 7 errors in the same file, starting at: node_modules/@types/mocha/index.d.ts:2650

  • 写回答

4条回答 默认 最新

  • 游一游走一走 2023-03-12 19:39
    关注

    Mocha and Jest 冲突哪,你能禁用一个么

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

问题事件

  • 系统已结题 3月20日
  • 已采纳回答 3月12日
  • 创建了问题 3月12日

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探