mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 12:28:44 -05:00
docs(cypress): add env variables info (#1327)
This commit is contained in:
committed by
Evan You
parent
476e52e0ad
commit
3a913a9ac7
@@ -31,6 +31,10 @@ Cypress offers a rich interactive interface for running E2E tests, but currently
|
||||
|
||||
We've pre-configured Cypress to place most of the e2e testing related files under `<projectRoot>/tests/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options).
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Cypress doesn't load .env files for your test files the same way as `vue-cli` does for your [application code](https://github.com/vuejs/vue-cli/blob/dev/docs/env.md#using-env-variables-in-client-side-code). Cypress supports a few ways to [define env variables](https://docs.cypress.io/guides/guides/environment-variables.html#) but the easiest one is to use .json files (either `cypress.json` or `cypress.env.json`) to define environment variables. Keep in mind those variables are accessible via `Cypress.env` function instead of regular `process.env` object.
|
||||
|
||||
## Installing in an Already Created Project
|
||||
|
||||
``` sh
|
||||
|
||||
Reference in New Issue
Block a user