javascript - Testcafe Applitools typescript - 错误 : Property 'accessibilityValidation' is missing in type

标签 javascript typescript compiler-errors testcafe applitools

我正在尝试执行此处找到的测试脚本 https://www.npmjs.com/package/@applitools/eyes-testcafe
但是我收到关于 typescript 转换的错误。
如果保存为 .js,则脚本会成功运行。

test/specs/applitoolsExample.ts:10:19 - error TS2345: Argument of type '{ appName: string; testName: string; browser: { width: number; height: number; name: "firefox"; }[]; t: TestController; }' is not assignable to parameter of type 'OpenOptions'.
  Property 'accessibilityValidation' is missing in type '{ appName: string; testName: string; browser: { width: number; height: number; name: "firefox"; }[]; t: TestController; }' but required in type 'OpenOptions'.

 10   await eyes.open({
                      ~
 11     appName: "Hello World!",
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
 14     t,
    ~~~~~~
 15   });
    ~~~

  node_modules/@applitools/eyes-testcafe/ts/eyes.ts:8:9
    8         accessibilityValidation: AccessibilitySettings
              ~~~~~~~~~~~~~~~~~~~~~~~
    'accessibilityValidation' is declared here.


Found 1 error.
我是 js、ts 和 testcafe 的新手,所以请不要假设。谁能建议如何使用 typescript 使 Applitools 在 testcafe 中工作?

最佳答案

看起来像 @applitools/eyes-testcafe 附带的 TypeScript 定义模块不正确。
更改test/specs/applitoolsExample.ts文件扩展名为 .js或在 applitools/eyes-testcafe 中写下有关此问题的问题存储库。
另外,你可以找到很多例子here .

关于javascript - Testcafe Applitools typescript - 错误 : Property 'accessibilityValidation' is missing in type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64969368/

相关文章:

java - 编译Java项目时出错

c++ - 在 C++ 应用程序中构建/编译 libcurl 时遇到问题

java - 在我的代码中找不到符号变量 java 错误

JavaScript 数组未定义?

javascript - CordovaJS-错误 : Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 19 declared in

javascript - 数组上的自定义 .toString() 方法

javascript - TypeScript - 模块在运行时未定义

javascript - 我可以使用表单中的文件字段发布内联图像吗

javascript - 如何使Typescript识别递归类型而不落在字符串上

javascript - 识别当前 for of 循环迭代 Typescript 中的下一项