equivalent of Cypress.env inside cypress.config.ts? #27440
Unanswered
dhorkin
asked this question in
Questions and Help
Replies: 1 comment 1 reply
-
Did you find any good enough satisfying answer for this question? Because I am also thinking to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
inside my
cypress.config.ts
, I'm effectively wanting to do this:But
Cypress.env
doesn't appear usable there. I could do this:but then if the environment variable
CYPRESS_bar
is defined, I would miss it.I could combine the two:
something: `foo.${process.env.CYPRESS_bar ?? barFromConfig}`
but this feels a bit hacky and would miss if it was overridden via
--env
, etc.I did notice that
e2e.setupNodeEvents(on, config)
has aconfig.env
, but it appears changing the value there doesn't persist. Trying to store a local variable of the value ofconfig.env
doesn't work either, since setupNodeEvents is called after defineConfigShort of reinventing the wheel / precedence order, is there a better option?
Beta Was this translation helpful? Give feedback.
All reactions