Skip to content

Conversation

@bahmutov
Copy link
Owner

@bahmutov bahmutov commented Jul 9, 2019

Adds an end-to-end test that checks if the server has the right NODE_ENV environment variable when we run it

To verify manually run in test/test-node-env folder

$ NODE_ENV=foo npm run demo

> test-node-env@ demo /Users/gleb/git/start-server-and-test/test/test-node-env
> node ../../src/bin/start.js 9000

starting server using command "npm run start"
and when url "http://localhost:9000" is responding
running tests using command "npm run test"

> test-node-env@ start /Users/gleb/git/start-server-and-test/test/test-node-env
> node ../server

sleeping for 5 seconds before starting
listening at port 9000
HEAD
HEAD
HEAD

> test-node-env@ test /Users/gleb/git/start-server-and-test/test/test-node-env
> echo server has NODE_ENV=$NODE_ENV

server has NODE_ENV=foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to set NODE_ENV=test?

2 participants