-
Notifications
You must be signed in to change notification settings - Fork 53
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
[Feature Request] Propagation of command line arguments to child processes required #105
Comments
Have you tried process.env in the child? |
I am actually passing env to the child https://github.com/kof/node-qunit/blob/master/lib/testrunner.js#L66 |
If it doesn't work, any ideas? |
I have seen that you pass |
If I understand correctly the documentation, passed env object should be accessible in the child as it is in the parent, no? |
Oh its process.argv, not process.env.argv ... |
I have a better solution for this. Now you can use process.argv in the child. |
check it out, reopen if something is wrong. |
Yes, you understand correctly: passed |
Using
node-qunit
for integration tests scenarios requires passing configuration options via command line to tests (like back-end host, etc.). Since test runner spawns new processes (child.js),process.argv
of the parent process is no longer available in tests (because each spawened process has it's ownprocess.argv
). This issue may be solved by propagating command line arguments (passed to cli.js) to child processes viaprocess.env
and used as follows:shell
test.js
For example jasmine-node allows to propagate command line arguments passed to cli.js using
--config argument_name argument_value
syntax.The text was updated successfully, but these errors were encountered: