parallel
Creates a new test scope, with tests that will be started in parallel.
static
parallel(name: string, f: (scope: TestScope) => void): void
Parameters
- name — The name of the test scope
- f — A function that’s run immediately, which should add tests using the test() function. The new TestScope instance is passed as the only argument.
Example
// these tests run in parallel:
describe.parallel("Foo", () => {
test(async () => {
// ... await something here
});
test(async () => {
// ... this runs at the same time
});
});
Related
- function describe(name, f)Creates a new test scope.