-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[jest-each]: Add test/describe timeout support #6660
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6660 +/- ##
=========================================
- Coverage 63.55% 63.35% -0.2%
=========================================
Files 235 235
Lines 9030 9031 +1
Branches 3 4 +1
=========================================
- Hits 5739 5722 -17
- Misses 3290 3308 +18
Partials 1 1
Continue to review full report at Codecov.
|
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.
Should it have an example in the docs as well?
@@ -237,6 +248,20 @@ describe('jest-each', () => { | |||
}); | |||
get(globalTestMocks, keyPath).mock.calls[0][1]('DONE'); | |||
}); | |||
|
|||
test('calls gloabl with given timeout', () => { |
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.
typo
@@ -234,6 +243,23 @@ describe('jest-each', () => { | |||
}); | |||
get(globalTestMocks, keyPath).mock.calls[0][1]('DONE'); | |||
}); | |||
|
|||
test('calls gloabl with given timeout', () => { |
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.
typo
docs/GlobalAPI.md
Outdated
@@ -243,6 +243,7 @@ Use `describe.each` if you keep duplicating the same test suites with different | |||
- `%o` - Object. | |||
- `%%` - single percent sign ('%'). This does not consume an argument. | |||
- `fn`: `Function` the suite of tests to be ran, this is the function that will receive the parameters in each row as function arguments. | |||
- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait before aborting. _Note: The default timeout is 5 seconds._ |
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.
👋 Thanks for proactively addressing #6749 before I even wrote it!
I think it is worth making it clear that this timeout is not for the entire parameterized test / test suite but for the individual "row" of data. For example:
Optionally, you can provide a
timeout
(in milliseconds) for specifying how long to wait for each row before aborting. Note: The default timeout is 5 seconds.
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.
@mattphillips mind addressing that?
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Add test/describe timeout support
Fixes #6749
Test plan
jest-each
unit testsjest-jasmine2
(we have integration tests that cover this so no need to maintain the unit tests in two places)