jestjs/jest

[jest-circus] suite level retry

Open

#10,520 创建于 2020年9月15日

在 GitHub 查看
 (10 评论) (10 反应) (0 负责人)TypeScript (45,361 star) (6,653 fork)batch import
:rocket: Feature RequestHelp WantedPinned

描述

🚀 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)

贡献者指南

[jest-circus] suite level retry · jestjs/jest#10520 | Good First Issue