Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add test for NODE_ENV in server process for #184 #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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?
1 participant