Skip to content

Commit

Permalink
Enable single thread mode for runner
Browse files Browse the repository at this point in the history
Some runners for tools that can not be run in parallel need a way
to specify that they should not be executed in parallel. This commits
adds this functionality.

Closes #5706
  • Loading branch information
DanielMSchmidt committed Mar 4, 2018
1 parent f7171b9 commit 63e9257
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
promises ([#5670](https://github.com/facebook/jest/pull/5670))
* `[expect]` Add isError to utils
([#5670](https://github.com/facebook/jest/pull/5670))
* `[jest-cli]` Add `serial` property that runners can expose to specify that
they can not run in parallel (#5706)

### Fixes

Expand Down
4 changes: 4 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,10 @@ async runTests(
): Promise<void>
```

If you need to restrict your test-runner to only run in serial rather then being
exectued in paralell your class should have the static attribute `serial` to be
set as `true`.

### `setupFiles` [array]

Default: `[]`
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/src/test_scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default class TestScheduler {
onResult,
onFailure,
{
serial: runInBand,
serial: runInBand || testRunners[runner].serial,
},
);
}
Expand Down

0 comments on commit 63e9257

Please sign in to comment.