Create React App
Set up a modern web app by running one command.
Running Cypress with `npm test` sets NODE_ENV to developmentNovember 14, 2019 at 10:53am (Edited 8 months ago)
I was about to create a issue but I'm sure this is more of a misunderstanding from my part so here goes:
I set up Cypress to run e2e tests on my application, which I run with
cypress open --config-file cypress/cypress.json). My problem is that the CRA docs say that with
NODE_ENVwill be automatically set to
testbut it's not the case here, and I cannot override the value in any way.
Could someone help me setting the correct value for this env var? Thanks :)
November 15, 2019 at 7:43am
You described your environment, but not the actual problem/challenge. What is it that you're trying to do and what's the result vs what you expect? Are you trying to run cypress via the
npm testscript, but it fails due to how CRA treats the
testscript and sets up a test environment? If so, why not add a script:
"test:e2e": "cypress open --config-file cypress/cypress.json"?
I can correctly run Cypress with the
npm testcommand, and everything runs fine except for the
NODE_ENVenvironment variable, which is supposed to be set to
testwhen using the
npm testcommand, but it is not in my case. Also I just thought about something: I guess I understand why the variable is set to
development, it's because I run the app alongside Cypress, with
npm start, so that's what sets
development. But in that case I don't want it to. So how am I supposed to do? Should I use concurrently in