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
- class TestCaseA class that represents a single test case, part of a TestScope.
- getCount(name)Returns the current value of a named counter.
- expectCount(name)Returns a new Assertion for the current value of a named counter.