method Assert.prototype.expect
Assert.prototype.expect(number: number): void

Sets the number of assertions expected to run in the current test. The test fails if a different number of assertions actually ran.

Examples

Example 1

test("exactly two assertions", (assert) => {
  assert.expect(2);
  assert.ok(true);
  assert.ok(true);
});

Parameters

number: number

Expected assertion count (non-negative integer).

Return Type

void

Usage

import { Assert } from ".";