Mif
Bun

method

test.Describe.if

condition: boolean
): Describe<T>;

Runs this group of tests, only if condition is true.

This is the opposite of describe.skipIf().

@param condition

if these tests should run

Referenced types

interface Describe<T extends Readonly<any[]>>

Describes a group of related tests.

function sum(a, b) {
  return a + b;
}
describe("sum()", () => {
  test("can sum two values", () => {
    expect(sum(1, 1)).toBe(2);
  });
});
  • concurrent: Describe<T>

    Marks this group of tests to be executed concurrently.

  • only: Describe<T>

    Skips all other tests, except this group of tests.

  • serial: Describe<T>

    Marks this group of tests to be executed serially (one after another), even when the --concurrent flag is used.

  • skip: Describe<T>

    Skips this group of tests.

  • todo: Describe<T>

    Marks this group of tests as to be written or to be fixed.

  • each<T extends any[]>(
    table: readonly T[]
    ): Describe<[...T[]]>;
    each<T>(
    table: T[]
    ): Describe<[T]>;
  • condition: boolean
    ): Describe<T>;

    Runs this group of tests, only if condition is true.

    This is the opposite of describe.skipIf().

    @param condition

    if these tests should run

  • condition: boolean
    ): Describe<T>;

    Skips this group of tests, if condition is true.

    @param condition

    if these tests should be skipped

  • condition: boolean
    ): Describe<T>;

    Marks this group of tests as to be written or to be fixed, if condition is true.

    @param condition

    if these tests should be skipped