FexpectFailure
Bun

function

test.default.suite.expectFailure

function expectFailure(
name?: string,
options?: TestOptions,
fn?: SuiteFn
): Promise<void>;

This flips the pass/fail reporting for a specific test or suite: a flagged test case must throw in order to pass, and a flagged test case that does not throw fails.

function expectFailure(
name?: string,
fn?: SuiteFn
): Promise<void>;

This flips the pass/fail reporting for a specific test or suite: a flagged test case must throw in order to pass, and a flagged test case that does not throw fails.

function expectFailure(
options?: TestOptions,
fn?: SuiteFn
): Promise<void>;

This flips the pass/fail reporting for a specific test or suite: a flagged test case must throw in order to pass, and a flagged test case that does not throw fails.

function expectFailure(
fn?: SuiteFn
): Promise<void>;

This flips the pass/fail reporting for a specific test or suite: a flagged test case must throw in order to pass, and a flagged test case that does not throw fails.