Skip to content

Modifiers

Modifiers let you focus on specific tests, skip others, or mark tests as planned but not yet implemented.

Run only the marked tests or suites. All other tests are skipped.

describe.only("focused suite", () => {
it("this runs", () => {
expect(true).toBe(true);
});
});
describe("other suite", () => {
it("this is skipped", () => { /* ... */ });
});

Works on individual tests too:

describe("math", () => {
it.only("this runs", () => {
expect(1 + 1).toBe(2);
});
it("this is skipped", () => { /* ... */ });
});

Multiple .only markers can coexist — all marked tests run, everything else is skipped.

Skip a test or suite entirely. Skipped tests appear in the output but don’t run.

describe.skip("broken feature", () => {
it("doesn't run", () => { /* ... */ });
});
it.skip("temporarily disabled", () => { /* ... */ });

Mark a test as planned but not yet implemented. No test function is needed:

it.todo("should validate email format");
it.todo("should handle edge case with empty input");
describe.todo("upcoming feature");

Todo tests appear in the output with a distinct indicator and don’t count as failures.

Pass a timeout in milliseconds as the third argument to it() or test() to override the global timeout for a specific test:

it("slow integration call", async () => {
await fetch("https://example.com/api");
}, 30_000); // 30 second timeout for this test only

The per-test timeout takes precedence over the global timeoutMs config option and the --timeout CLI flag.

Each status has a distinct indicator in the CLI output:

StatusSymbolColor
PassGreen
FailRed
SkipYellow
TodoMagenta