https://cypress.io logo
You'd be able to access `Cypress.env('ENVIRONMENT'...
# e2e-testing
f
You'd be able to access
Cypress.env('ENVIRONMENT')
within your specs, but
cypress.config.ts
runs in node as part of the setup process, so you don't have access to the
Cypress
object yet If you need to get it in there, you can reach it with
process.env.CYPRESS_ENVIRONMENT
, though at that point I'd probably just pass it in as
ENVIRONMENT
. You can also take that variable and assign it to so that you can access it in Cypress.env later:
Copy code
setupNodeEvents(_on, config) {
      config.env.ENVIRONMENT = process.env.ENVIRONMENT;

      return config;
    },
Hope that helps!