Docs (4.0.0)
class TestCase method

count

Increment a named counter.

count(name: string, inc?: number): void

Parameters

  • name — The name of the counter to increment
  • inc — The amount with which to increment, defaults to 1

Example

describe("My scope", () => {
  test("My test", (t) => {
    t.count("foo"); // +1
    t.count("foo", 2); // +2
    t.expectCount("foo").toBe(3); // OK
  });
});

Related