首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cy.pa11y类型记录错误:'cy &CyEventEmitter‘..ts(2339)类型中不存在属性'pa11y’

cy.pa11y类型记录错误:'cy &CyEventEmitter‘..ts(2339)类型中不存在属性'pa11y’
EN

Stack Overflow用户
提问于 2022-09-21 17:23:47
回答 1查看 26关注 0票数 0

我使用的是Cypress 10.4.0,我使用的是打字本。测试运行良好,但我的编辑器VSCode在本例中有一个ts error,如下所示:

有什么办法解决吗?这是我的tsconfig.json:

代码语言:javascript
复制
{
  "compilerOptions": {
    "strict": true,
    "baseUrl": "../node_modules",
    "target": "es5",
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "lib": ["es5", "dom"],
    "jsx": "react",
    "types": ["cypress", "@testing-library/cypress"],
    "paths": {
      "@cypress/*": ["../cypress/support/*"],
      "@interceptors/*": ["../cypress/interceptors/*"],
      "@fixtures/*": ["../cypress/fixtures/*"]
    }
  },
  "include": ["**/*.ts"]
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-21 17:23:47

只需将cypress-audit包含在tsconfig-json中即可

代码语言:javascript
复制
{
  "compilerOptions": {
    "strict": true,
    "baseUrl": "../node_modules",
    "target": "es5",
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "lib": ["es5", "dom"],
    "jsx": "react",
    "types": ["cypress", "@testing-library/cypress"],
    "paths": {
      "@cypress/*": ["../cypress/support/*"],
      "@interceptors/*": ["../cypress/interceptors/*"],
      "@fixtures/*": ["../cypress/fixtures/*"]
    }
  },
  "include": ["./**/*.ts", "../node_modules/cypress-audit"] // This is missing.
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73804750

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档