Interface describe

Registers a test suite.

interface describe {
    constructor: any;
    ignore<T>(...args: DescribeArgs<T>): TestSuite<T>;
    only<T>(...args: DescribeArgs<T>): TestSuite<T>;
    skip<T>(...args: ItArgs<T>): void;
    ignore<T>(...args: DescribeArgs<T>): TestSuite<T>;
    only<T>(...args: DescribeArgs<T>): TestSuite<T>;
    skip<T>(...args: DescribeArgs<T>): TestSuite<T>;
    <T>(...args: DescribeArgs<T>): TestSuite<T>;
}

Constructors

Methods

Constructors

constructor: any

Methods

  • Registers a test suite with ignore set to true. Alias of .ignore().

    Type Parameters

    • T

    Parameters

    Returns void

  • Ignore the test suite.

    Type Parameters

    • T

    Parameters

    Returns TestSuite<T>

    import { describe, it, beforeAll } from "@std/testing/bdd";
    import { assertEquals } from "@std/assert";

    describe("example", () => {
    it("should pass", () => {
    assertEquals(2 + 2, 4);
    });
    });

    describe.ignore("example 2", () => {
    it("should pass too", () => {
    assertEquals(3 + 4, 7);
    });
    });
  • Only execute this test suite.

    Type Parameters

    • T

    Parameters

    Returns TestSuite<T>

    import { describe, it, beforeAll } from "@std/testing/bdd";
    import { assertEquals } from "@std/assert";

    describe("example", () => {
    it("should pass", () => {
    assertEquals(2 + 2, 4);
    });
    });

    // Only this test suite will run
    describe.only("example 2", () => {
    it("should pass too", () => {
    assertEquals(3 + 4, 7);
    });
    });
  • Skip the test suite.

    Type Parameters

    • T

    Parameters

    Returns TestSuite<T>

    import { describe, it, beforeAll } from "@std/testing/bdd";
    import { assertEquals } from "@std/assert";

    describe("example", () => {
    it("should pass", () => {
    assertEquals(2 + 2, 4);
    });
    });

    describe.skip("example 2", () => {
    it("should pass too", () => {
    assertEquals(3 + 4, 7);
    });
    });