jestjs/jest

[jest-circus] suite level retry

Open

#10520 opened on Sep 15, 2020

View on GitHub
 (10 comments) (10 reactions) (0 assignees)TypeScript (45,361 stars) (6,653 forks)batch import
:rocket: Feature RequestHelp WantedPinned

Description

🚀 Feature Proposal

Support test suite level retry

Motivation

currently jest-circus only support re-run test cases according to https://github.com/facebook/jest/blob/23f425c15a5cdf80dd165a1b50c07b92edb8c10c/packages/jest-circus/src/run.ts#L69

however, in common e2e test scenario, some test cases are not isolated with others, they depend on the status of the previous test cases, so retry in test case level may be not helpful but suite level can

Example

maybe we can extend the jest.retryTimes method:

jest.retryTimes(TestCaseNumRetries: number, TestSuiteNumRetries?: number);

just a proposal, I am not good at design api. but if you guys think my proposal is doable, I'm glad to send a PR to implement it. 🤣

Pitch

Why does this feature belong in the Jest core platform?

Common feature proposals that do not typically make it to core:

  • New matchers (see jest-extended)
  • Changes to the default reporter (use custom reporters instead)
  • Changes to node/jsdom test environments (use custom environments instead)

Contributor guide