Function describe

  • Registers a test suite.

    Type Parameters

    • T

      The self type of the test suite body.

    Parameters

    Returns TestSuite<T>

    The test suite

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

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

Methods

Methods

  • 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);
    });
    });