Docs (4.0.0)
Tests

class TestCase

A class that represents a single test case, part of a TestScope.

class TestCase

Description

Test cases are created using calls to test(). The TestCase instance is passed to the function argument when the test itself is run, so it can use its own TestCase methods — for example to capture log output, keep track of counts, or fail early.

Example

describe("My test scope", () => {
  test("My test case", (t) => {
    // => t is a TestCase instance
    t.log("Logging some values", 123);
    t.fail(new Error("Whoops!"));
  });
});

Instance Members