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

Running tests doesn't set NODE_ENV=test #353

Closed
RobinClowers opened this issue May 9, 2017 · 6 comments
Closed

Running tests doesn't set NODE_ENV=test #353

RobinClowers opened this issue May 9, 2017 · 6 comments

Comments

@RobinClowers
Copy link

When I run tests with bin/rails test, it fails unless I'm running the webpack dev server. Is this expected?

@gauravtiwari
Copy link
Member

@RobinClowers You would need to compile packs before running tests - NODE_ENV=test ./bin/webpack. Are you getting somefile not found error when running tests?

@RobinClowers
Copy link
Author

Yeah, that's exactly right, and NODE_ENV=test ./bin/webpack does sort it out. I feel like the readme could really use a section breaking down how the manifests are used and options for how to run tests locally vs CI.

@gauravtiwari
Copy link
Member

@RobinClowers Yepp. There are two PR's pending to address some of these things - #341 and #292

@RobinClowers
Copy link
Author

@gauravtiwari is there an easy way to use the dev server for tests locally, but use precompiled assets on CI?

@gauravtiwari
Copy link
Member

@RobinClowers What issues are you facing? You can run dev server locally in a separate terminal and then run tests, which would work just fine as it will use dev server to serve assets. For CI, you can pre-compile NODE_ENV=test ./bin/webpack before running tests (much like assets:precompile).

@RobinClowers
Copy link
Author

@gauravtiwari oh I see, for some reason I thought it would only use the test assets, that does indeed work. Thanks!

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

No branches or pull requests

2 participants