2246db680e
[Cypress](https://www.cypress.io/) recently went GA with a Component Testing offering which supports Next.js. This PR adds a brief section on what and how to use Cypress for component-level testing and updates the example project with a component test. Any feedback on content or the example is welcome, thanks for considering! ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm build && pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
25 lines
702 B
JSON
25 lines
702 B
JSON
{
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"e2e": "start-server-and-test dev http://localhost:3000 \"cypress open --e2e\"",
|
|
"e2e:headless": "start-server-and-test dev http://localhost:3000 \"cypress run --e2e\"",
|
|
"component": "cypress open --component",
|
|
"component:headless": "cypress run --component"
|
|
},
|
|
"dependencies": {
|
|
"next": "latest",
|
|
"react": "18.2.0",
|
|
"react-dom": "18.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "18.0.6",
|
|
"@types/react": "18.0.15",
|
|
"@types/react-dom": "18.0.6",
|
|
"cypress": "12.3.0",
|
|
"start-server-and-test": "1.15.2",
|
|
"typescript": "4.7.4"
|
|
}
|
|
}
|