packages/server/README.md
The server is the heart of the Cypress application. All of this code represents the node process running behind the browser application. This node process is responsible for:
The driver and the server are the two most complex packages of Cypress.
To run the Cypress server:
## boots the entire Cypress application
yarn start
Since the server controls nearly every aspect of Cypress, after making changes you'll need to manually restart Cypress.
Since this is slow, it's better to drive your development with tests.
Note: you should not ever need to build the .js files manually. @packages/ts provides require-time transpilation when in development.
yarn workspace @packages/server build-prod
yarn test-unit executes unit tests in test/unityarn test-integration executes integration tests in test/integrationyarn test-performance executes performance tests in test/performanceYou can also use the test-watch command to rerun a test file whenever there is a change:
yarn test-watch /test/path/to/spec.js
yarn test <path/to/test>
yarn test test/unit/api_spec.js
## or
yarn test-unit api_spec ## shorthand, uses globbing to find spec
yarn test <path/to/test>
yarn test test/integration/cli_spec.js
## or
yarn test-integration cli_spec ## shorthand, uses globbing to find spec
With the addition of Component Testing,
e2etests have been renamed tosystem-testsand moved to thesystem-testsdirectory.
Prepend SNAPSHOT_UPDATE=1 to any test command. See snap-shot-it instructions for more info.
SNAPSHOT_UPDATE=1 yarn test test/unit/api_spec.js
SNAPSHOT_UPDATE=1 yarn test test/integration/cli_spec.js
In order to improve start up time, Cypress uses electron mksnapshot for generating v8 snapshots for both development and production.
Cypress code is automatically set up to run using snapshots. If you want to run Cypress in development without the v8 snapshot (for debugging purposes or to see if there's a problem with the snapshot or the code itself) you can set the environment variable DISABLE_SNAPSHOT_REQUIRE to 1 or true.