0

I've added the Cypress Vue Component Test runner to an existing Vue app and I want all the test files to be in the same directory as the components. However, whatever I put in my cypress.json file seems to be ignored and cypress always wants to look in the default integration folder.

In my cypress.json file I have:

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

but when I run

npm run cy:run:chrome

I get:

> 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
Richard Shergold
  • 572
  • 1
  • 8
  • 21

1 Answers1

1

You can change the default folder that Cypress looks in for tests using integrationFolder in your cypress.json. This value defaults to cypress/integration.

Even when adding a testFiles field, Cypress will restrict that search to the integrationFolder value.

...
"integrationFolder": "/path/to/tests/folder",
...
agoff
  • 5,818
  • 1
  • 7
  • 20