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

[jest-each]: Add test/describe timeout support #6660

Merged
merged 7 commits into from
Aug 9, 2018

Conversation

mattphillips
Copy link
Contributor

@mattphillips mattphillips commented Jul 9, 2018

Summary

Add test/describe timeout support

Fixes #6749

Test plan

  • Updated jest-each unit tests
  • Remove duplicate unit tests in jest-jasmine2 (we have integration tests that cover this so no need to maintain the unit tests in two places)

@mattphillips mattphillips changed the title [jest-eachAdd test timeout to jest-each [jest-each]: Add test/describe timeout support Jul 9, 2018
@codecov-io
Copy link

codecov-io commented Jul 9, 2018

Codecov Report

Merging #6660 into master will decrease coverage by 0.19%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
packages/jest-each/src/index.js 77.77% <100%> (ø) ⬆️
packages/jest-each/src/bind.js 86.74% <100%> (-13.26%) ⬇️
packages/jest-jasmine2/src/each.js 0% <0%> (-100%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db28956...8334488. Read the comment docs.

Copy link
Member

@SimenB SimenB left a 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', () => {
Copy link
Member

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', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@@ -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._

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattphillips mind addressing that?

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add timeouts to test.each implementations
6 participants