jestjs/jest

[jest-circus] suite level retry

Open

#10 520 ouverte le 15 sept. 2020

Voir sur GitHub
 (10 commentaires) (10 réactions) (0 assignés)TypeScript (6 653 forks)batch import
:rocket: Feature RequestHelp WantedPinned

Métriques du dépôt

Stars
 (45 361 stars)
Métriques de merge PR
 (Merge moyen 11j 22h) (11 PRs mergées en 30 j)

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)

Guide contributeur