Files
cypress/npm/react/examples/react-scripts-folder
Dmitriy Kovalenko 9c642369fc chore(component-testing): Remove useless code & deps in @cypress/react and @cypress/vue (#15113)
* Remove useless code

* Add code-coverage to reacr devDependencies

* Remove react/support imports

* Remove some useless code from @cypress/react

* Cleanup vue

* Make it works :)

* Fix react errors

* Fix next.js react example

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Barthélémy Ledoux <bart@cypress.io>
2021-02-19 14:58:40 -06:00
..
2020-10-14 10:55:57 -04:00
2020-10-14 10:55:57 -04:00

example: react-scripts-folder

A typical project using react-scripts with components in the src folder and component tests inside cypress/component folder.

Cypress automatically finds Webpack settings used by react-scripts and inserts the component folder name allowing to transpile the component specs the same way the src code is transpiled.

App test

Usage

  1. Make sure the root project has been built .
# in the root of the project
npm install
npm run build
  1. Run npm install in this folder to symlink the @cypress/react dependency.
# in this folder
npm install
  1. Start Cypress
npm run cy:open
# or just run headless tests
npm test