-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Improve tests following lint advice from eslint-node-test #2560
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
Merged
shadowspawn
merged 19 commits into
tj:develop
from
shadowspawn:feature/eslint-node-test
Jul 27, 2026
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
3e513aa
Remove duplicate test
shadowspawn f9c56f6
Remove bogus call to configureHelp in test
shadowspawn c479ead
Add eslint-node-test
shadowspawn 5e3537b
Add checks on what throws in tests
shadowspawn acbd58e
Update eslint
shadowspawn 4d6bd49
Lint for tests, mostly adding some sort of test on what is thrown by …
shadowspawn f8f24f4
Lint for tests, mostly adding some sort of test on what is thrown by …
shadowspawn 3b13cb8
remove trailing spaces from test names
shadowspawn 469ef4d
Single line of code in assert.throws()
shadowspawn c9a9e98
Use assert.of(value) rather than assert(value)
shadowspawn b994466
Major refactor to simplify tests
shadowspawn 98c275f
Use assert.ok(foo) rather than assert(foo)
shadowspawn d74dd8b
Just have one line of code inside assert.throws()
shadowspawn d1fa7ad
Use local assert context for mocks
shadowspawn 8b51112
Switch note-test lint to use recommended
shadowspawn 67d7c8a
Turn off lint on env in tests
shadowspawn bf0ea6d
Update eslint-node-test and reenable no-constant-assertion
shadowspawn 6d98ccb
Turn on node-test/require-top-level-describe and fix resulting lint e…
shadowspawn d1218dd
Merge remote-tracking branch 'upstream/develop' into feature/eslint-n…
shadowspawn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import assert from 'node:assert/strict'; | |
|
|
||
| // Testing variadic arguments. Testing all the action arguments, but could test just variadicArg. | ||
|
|
||
| describe('Command variadic argument using .argument()', (t) => { | ||
| describe('Command variadic argument using .argument()', () => { | ||
| test('when no extra arguments specified for program then variadic arg is empty array', (t) => { | ||
| const actionMock = t.mock.fn(); | ||
| const program = new commander.Command(); | ||
|
|
@@ -117,17 +117,4 @@ describe('Command variadic argument using .argument()', (t) => { | |
| program.parse(['one', 'two'], { from: 'user' }); | ||
| assert.deepEqual(passedArg, ['one', 'two']); | ||
| }); | ||
|
|
||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate of above test |
||
| test('when variadic has default array then specified value is used instead of default (not appended)', () => { | ||
| const program = new commander.Command(); | ||
| let passedArg; | ||
| program | ||
| .addArgument(new commander.Argument('[value...]').default(['DEFAULT'])) | ||
| .action((value) => { | ||
| passedArg = value; | ||
| }); | ||
|
|
||
| program.parse(['one', 'two'], { from: 'user' }); | ||
| assert.deepEqual(passedArg, ['one', 'two']); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bogus call I spotted myself, not one reported by the linter.