https://github.com/bahmutov/next-state-overwrite-example
Example overwriting NEXT_STATE from a Cypress test
https://github.com/bahmutov/next-state-overwrite-example
cypress-example
Last synced: 9 months ago
JSON representation
Example overwriting NEXT_STATE from a Cypress test
- Host: GitHub
- URL: https://github.com/bahmutov/next-state-overwrite-example
- Owner: bahmutov
- Created: 2021-07-16T18:31:18.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T14:29:43.000Z (over 2 years ago)
- Last Synced: 2025-01-18T22:38:16.273Z (over 1 year ago)
- Topics: cypress-example
- Language: JavaScript
- Homepage: https://glebbahmutov.com/blog/control-nextjs-data-during-tests/
- Size: 359 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# next-state-overwrite-example
[![ci status][ci image]][ci url] [![badges status][badges image]][badges url] [](https://dashboard.cypress.io/projects/onn62n/runs)
[![renovate-app badge][renovate-badge]][renovate-app] 
> Example overwriting Next.js variable NEXT_STATE from a Cypress test
Read the blog post [Control Next.js Server-Side Data During Cypress Tests
](https://glebbahmutov.com/blog/control-nextjs-data-during-tests/)

See [cypress/integration/spec.js](./cypress/integration/spec.js)
## Install and start
```shell
$ yarn
$ yarn local
```
Should start the application and open Cypress test runner
[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg
[renovate-app]: https://renovateapp.com/
[ci image]: https://github.com/bahmutov/next-state-overwrite-example/workflows/ci/badge.svg?branch=main
[ci url]: https://github.com/bahmutov/next-state-overwrite-example/actions
[badges image]: https://github.com/bahmutov/next-state-overwrite-example/workflows/badges/badge.svg?branch=main
[badges url]: https://github.com/bahmutov/next-state-overwrite-example/actions