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

CLI --seed without value and files argument is counterintuitive #1691

Open
Krinkle opened this issue May 1, 2022 · 0 comments
Open

CLI --seed without value and files argument is counterintuitive #1691

Krinkle opened this issue May 1, 2022 · 0 comments

Comments

@Krinkle
Copy link
Member

Krinkle commented May 1, 2022

Usage: qunit [options] [files]

[…]

Options:
  --seed [value]         specify a seed to re-order your tests;
                         if specified without a value, a seed will be generated
  […]

When using qunit --seed it will default to running test/**.js and will print the randomly selected seed for future re-use. This works as expected:

$ qunit --seed
Running tests with seed: 3vjdr2nhlga
TAP version 13
ok 1 Single > has a test
1..1
# pass 1
# skip 0
# todo 0
# fail 0

The problem is, when using a files argument, the command becomes ambiguous and it naturally becomes the value for the seed instead:

$ qunit --seed test/single.js
Running tests with seed: test/single.js
[…]

This can be worked around currently by using -- to mark the end of the options and the start of the arguments:

$ qunit --seed -- test/single.js 
Running tests with seed: 3vjdr2nhlga
TAP version 13
ok 1 Single > has a test
1..1
# pass 1
# skip 0
# todo 0
# fail 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant