only
Adds a test case that will be run exclusively.
static
only(name: string, f: (test: TestCase) => void | Promise<void>): void
Notes
- Multiple exclusive tests can be added at the same time. Only those test will run, and none of the others.
Example
// run only one test
describe("Something", () => {
test.only("This will run", () => {
// ... this will run
})
test("Another test", () => {
// ... this will not run
})
});
Related
- function test(name, f)Adds a test case in the current scope.