Docs (4.0.0)
function test function

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