I am trying to run npm run test
, where part of test is setting an environment variable using cross-env
. However, in Cypress testing the environment variable is not actually changed. Thanks for the help!
I am using Windows, with a cross-env
version of 5.0.1.
I have tried to set the several environment variable with different combinations, such as SET && and setting it in different places in the command but none have actually changed the environment variable. I also tried installing better-npm-run
but it did not help solve this problem.
I am running npm run test, where in test RECAPTCHA_SITE_KEY is an environment variable and start is npm run dev.
test: cross-env RECAPTCHA_SITE_KEY='6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' start-server-and-test start http-get://127.0.0.1:8080
Instead of the recaptcha key changing, the original site key is being used instead.
test: cross-env RECAPTCHA_SITE_KEY...
is, it looks like pseudocode. Good tips here on how to create a Minimal, Reproducible Example.package.json
? That doesn't look like JSON. I wonder if it's a syntax problem? Should look something like{ "scripts" : { "test" : "cross-env RECAPTCHA_SITE_KEY..." ... } ... }
.