Skip to content

Commit d243db9

Browse files
committed
add PR feedback
1 parent 1e31170 commit d243db9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

content/guides/getting-started/component-framework-configuration.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ By default, Cypress looks for spec files anywhere in your project with an
258258
extension of either `.cy.js`, `.cy.jsx`, `.cy.ts`, or `.cy.tsx`. However, you
259259
can change this behavior with a custom `specPattern` value. In the following
260260
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.
262263

263264
:::cypress-config-plugin-example
264265

@@ -270,15 +271,15 @@ const { devServer } = require('@cypress/react/plugins/next')
270271
{
271272
component: {
272273
devServer,
273-
specPattern: 'pages/**/*.cy.{js,jsx,ts,tsx}'
274+
specPattern: '{pages,components}/**/*.cy.{js,jsx,ts,tsx}'
274275
}
275276
}
276277
```
277278

278279
```json
279280
{
280281
"component": {
281-
"specPattern": "pages/**/*.cy.{js,jsx,ts,tsx}"
282+
"specPattern": "{pages,components}/**/*.cy.{js,jsx,ts,tsx}"
282283
}
283284
}
284285
```
@@ -378,7 +379,8 @@ By default, Cypress looks for spec files anywhere in your project with an
378379
extension of either `.cy.js`, `.cy.jsx`, `.cy.ts`, or `.cy.tsx`. However, you
379380
can change this behavior with a custom `specPattern` value. In the following
380381
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.
382384

383385
While it's possible to mount components in the `pages` directory, generally you
384386
will want to be more granular with your component tests - full page tests are
@@ -401,15 +403,15 @@ const { getWebpackConfig } = require('nuxt')
401403
webpackConfig,
402404
})
403405
},
404-
specPattern: 'components/**/*.cy.{js,jsx,ts,tsx}'
406+
specPattern: '{pages,components}/**/*.cy.{js,jsx,ts,tsx}'
405407
}
406408
}
407409
```
408410

409411
```json
410412
{
411413
"component": {
412-
"specPattern": "components/**/*.cy.{js,jsx,ts,tsx}"
414+
"specPattern": "{pages,components}/**/*.cy.{js,jsx,ts,tsx}"
413415
}
414416
}
415417
```

0 commit comments

Comments
 (0)