@@ -258,7 +258,8 @@ By default, Cypress looks for spec files anywhere in your project with an
258
258
extension of either ` .cy.js ` , ` .cy.jsx ` , ` .cy.ts ` , or ` .cy.tsx ` . However, you
259
259
can change this behavior with a custom ` specPattern ` value. In the following
260
260
example, we've configured Cypress to look for spec files with those same
261
- extensions, but only in the ` pages ` folder or any of its subdirectories.
261
+ extensions, but only in the ` pages ` and ` components ` folders or any of their
262
+ subdirectories.
262
263
263
264
::: cypress-config-plugin-example
264
265
@@ -270,15 +271,15 @@ const { devServer } = require('@cypress/react/plugins/next')
270
271
{
271
272
component: {
272
273
devServer,
273
- specPattern: ' pages/**/*.cy.{js,jsx,ts,tsx}'
274
+ specPattern: ' { pages,components} /**/*.cy.{js,jsx,ts,tsx}'
274
275
}
275
276
}
276
277
```
277
278
278
279
``` json
279
280
{
280
281
"component" : {
281
- "specPattern" : " pages/**/*.cy.{js,jsx,ts,tsx}"
282
+ "specPattern" : " { pages,components} /**/*.cy.{js,jsx,ts,tsx}"
282
283
}
283
284
}
284
285
```
@@ -378,7 +379,8 @@ By default, Cypress looks for spec files anywhere in your project with an
378
379
extension of either ` .cy.js ` , ` .cy.jsx ` , ` .cy.ts ` , or ` .cy.tsx ` . However, you
379
380
can change this behavior with a custom ` specPattern ` value. In the following
380
381
example, we've configured Cypress to look for spec files with those same
381
- extensions, but only in the ` components ` folder or any of its subdirectories.
382
+ extensions, but only in the ` pages ` and ` components ` folders or any of their
383
+ subdirectories.
382
384
383
385
While it's possible to mount components in the ` pages ` directory, generally you
384
386
will want to be more granular with your component tests - full page tests are
@@ -401,15 +403,15 @@ const { getWebpackConfig } = require('nuxt')
401
403
webpackConfig,
402
404
})
403
405
},
404
- specPattern: ' components/**/*.cy.{js,jsx,ts,tsx}'
406
+ specPattern: ' {pages, components} /**/*.cy.{js,jsx,ts,tsx}'
405
407
}
406
408
}
407
409
```
408
410
409
411
``` json
410
412
{
411
413
"component" : {
412
- "specPattern" : " components/**/*.cy.{js,jsx,ts,tsx}"
414
+ "specPattern" : " {pages, components} /**/*.cy.{js,jsx,ts,tsx}"
413
415
}
414
416
}
415
417
```
0 commit comments