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

feat(cli): module option #1681

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ program
"any tests.", collect, [] )
.option( "--seed [value]", "specify a seed to re-order your tests; " +
"if specified without a value, a seed will be generated" )
.option( "-w, --watch", "watch files for changes and re-run the test suite" )
.option("-m, --module <module_name>", "run a specific module")
.option("-w, --watch", "watch files for changes and re-run the test suite")
// allow passing options to handle in setup files
.allowUnknownOption()
.allowExcessArguments()
.parse( process.argv );

const opts = program.opts();
Expand All @@ -46,7 +50,8 @@ const options = {
filter: opts.filter,
reporter: opts.reporter,
requires: opts.require,
seed: opts.seed
seed: opts.seed,
module: opts.module
};

if ( opts.watch ) {
Expand Down
3 changes: 3 additions & 0 deletions src/cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ async function run( args, options ) {
if ( options.filter ) {
QUnit.config.filter = options.filter;
}
if ( options.module ) {
QUnit.config.module = options.module;
}

const seed = options.seed;
if ( seed ) {
Expand Down