Skip to content

[Feature Request] Propagation of command line arguments to child processes required #105

Description

@micellius

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 own process.argv). This issue may be solved by propagating command line arguments (passed to cli.js) to child processes via process.env and used as follows:

shell

$ ./node_modules/qunit/bin/cli.js -c src/code.js -t test/test.js --host test.domain.com

test.js

var host = process.env['qunit.args.host']; // <-- will be "test.domain.com"

For example jasmine-node allows to propagate command line arguments passed to cli.js using --config argument_name argument_value syntax.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions