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.
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
tests: start replacing jest with mocha, starting with unit-cli #13568
tests: start replacing jest with mocha, starting with unit-cli #13568
Changes from 22 commits
e15d486
b57b6d6
5f1f6be
2bd3231
f92351a
e10c0ac
2f7f891
c4d591b
d4d4830
5b2b8b0
5b03510
b553be9
e7eb722
8f8eaea
b084502
939e1d0
dbb8e60
2b3e56b
4f96ce4
d00d94a
071ae8e
b311566
71198a5
0cebb33
7f0a250
1092625
9bea135
7e3912d
e4d3a62
b3c9ecf
39eef45
4cff085
8eedc78
6656a0b
74336c5
c8c69a0
b497806
8ab1d52
bc1c959
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
eslint-env mocha now?
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.
with jest
import yargs from 'yargs
here and in the test file results inyargs.getGroups()
working in the test file. That function is added to the module dynamically after being called, which is why this test did this seemingly no-op call togetFlags
.But, that property is only added to the module object in jest because ... reasons? The modules aren't really es modules, I guess, and es module objects are read-only, IIRC.
Anyhow, the
getGroups
method is also added to the yargs parser object, so to get to that I split up the implementation across two functions.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.
There's no timeout parameter for mocha hook functions, but there is for jest lifecycle functions.
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.
Mocha does
global.before
, jest doesglobal.beforeAll
. To make transition slightly easier, I thought having the same interface for some parts would be helpful.