Mocha `retries` 回调参数不会在打字稿中编译

Mocha `retries` callback argument doesn't compile in typescript

以下代码无法在 ts 中编译,但在 es2015 中运行良好

it('should do stuff', () => {
    expect(HomePage.title.getText()).to.be.eq('Google');
}, 3); // retries 3 times, works in ES6 but doesn't even compile in typescript

错误消息: [ts] 需要 1-2 个参数,但得到了 3 个。

去掉, 3后会编译,如何让IDE理解ts中的重试回调?是tsconfig的问题吗?我正在使用 VS 代码。

how can I make the IDE understand the retry callback in ts

文档没有显示这个论点:https://mochajs.org/#retry-tests

修复

  • 代码无效,TypeScript 正在指出。
  • 按照文档获取正确的代码,即使用 this.retries