From 7ddad997c39507c97b099907ab63c36fd0bfead2 Mon Sep 17 00:00:00 2001 From: lme-agicap <116797118+lme-agicap@users.noreply.github.com> Date: Wed, 16 Nov 2022 11:22:16 +0100 Subject: [PATCH] feat(jest): support shard CLI options (#1314) (#1315) --- packages/jest/scripts/ci.sh | 1 + packages/jest/src/schema.json | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/jest/scripts/ci.sh b/packages/jest/scripts/ci.sh index 88bbd5ef1..3fc7634f6 100755 --- a/packages/jest/scripts/ci.sh +++ b/packages/jest/scripts/ci.sh @@ -67,6 +67,7 @@ simpleAppTestOptions=( "yarn test|--no-cache|1|1|3|3|||" "yarn test|--test-name-pattern=^AppComponent should create the app$|1|1|1|3|2||" "yarn test|--reporters=default;--reporters=jest-junit|1|1|3|3||checkJunit" + "yarn test|--shard=1/2|1|1|3|3||" ) multiAppTestOptions=( diff --git a/packages/jest/src/schema.json b/packages/jest/src/schema.json index ed50a09d7..286c09f9d 100644 --- a/packages/jest/src/schema.json +++ b/packages/jest/src/schema.json @@ -482,6 +482,10 @@ "tsConfig": { "description": "The path to the TypeScript configuration file.", "type": "string" + }, + "shard": { + "description": "The test suite shard to execute in a format of (?\\d+)/(?\\d+).\n\nshardIndex describes which shard to select while shardCount controls the number of shards the suite should be split into.\n\nshardIndex and shardCount have to be 1-based, positive numbers, and shardIndex has to be lower than or equal to shardCount.\n\nWhen shard is specified the configured testSequencer has to implement a shard method.\n\nFor example, to split the suite into three shards, each running one third of the tests:", + "type": "string" } }, "additionalProperties": { "type": "array", "items": { "type": "string" } }