Skip to content

Commit

Permalink
feat(testing): add --randomize flag for jest
Browse files Browse the repository at this point in the history
  • Loading branch information
barbados-clemens committed May 24, 2023
1 parent fc38dc1 commit e8013d2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/generated/packages/jest/executors/jest.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
"description": "Will not fail if no tests are found (for example while using `--testPathPattern`.) (https://jestjs.io/docs/cli#--passwithnotests)",
"type": "boolean"
},
"randomize": {
"description": "Shuffle the order of the tests within a file. The shuffling is based on the seed. This option is only supported using the default jest-circus test runner.",
"type": "boolean"
},
"runInBand": {
"alias": "i",
"description": "Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI. (https://jestjs.io/docs/cli#--runinband)",
Expand Down
1 change: 1 addition & 0 deletions packages/jest/src/executors/jest/jest.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export async function jestConfigParser(
useStderr: options.useStderr,
watch: options.watch,
watchAll: options.watchAll,
randomize: options.randomize,
};

if (!multiProjects) {
Expand Down
1 change: 1 addition & 0 deletions packages/jest/src/executors/jest/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface JestExecutorOptions {
changedSince?: string;
outputFile?: string;
passWithNoTests?: boolean;
randomize?: boolean;
runInBand?: boolean;
showConfig?: boolean;
silent?: boolean;
Expand Down
4 changes: 4 additions & 0 deletions packages/jest/src/executors/jest/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
"description": "Will not fail if no tests are found (for example while using `--testPathPattern`.) (https://jestjs.io/docs/cli#--passwithnotests)",
"type": "boolean"
},
"randomize": {
"description": "Shuffle the order of the tests within a file. The shuffling is based on the seed. This option is only supported using the default jest-circus test runner.",
"type": "boolean"
},
"runInBand": {
"alias": "i",
"description": "Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI. (https://jestjs.io/docs/cli#--runinband)",
Expand Down

0 comments on commit e8013d2

Please sign in to comment.