0

我已将 Cypress Vue 组件测试运行器添加到现有的 Vue 应用程序中,并且我希望所有测试文件与组件位于同一目录中。但是,我在 cypress.json 文件中放入的任何内容似乎都被忽略了,并且 cypress 总是想查看默认的集成文件夹。

在我的 cypress.json 文件中,我有:

{
    "component": {
      "componentFolder": "src",
      "testFiles": "**/*.spec.ts",
      "testMatch": [
        "**/src/**/*.spec.[jt]s?(x)"
      ]
    },
}

但是当我跑步时

npm run cy:run:chrome

我得到:

> vue-myapp@0.1.0 cy:run:chrome
> cypress run --browser chrome

Can't run because no spec files were found.

We searched for any files inside of this folder:

/Users/richardshergold/Projects/vue-myapp/cypress/integration
4

1 回答 1

1

您可以更改赛普拉斯integrationFoldercypress.json. 此值默认为cypress/integration

即使在添加testFiles字段时,赛普拉斯也会将该搜索限制为该integrationFolder值。

...
"integrationFolder": "/path/to/tests/folder",
...
于 2021-12-02T14:40:26.787 回答