method Assert.prototype.equal
Assert.prototype.equal(
actual: unknown,
expected: unknown,
message?: string
): void

Asserts that actual == expected (loose equality, allows type coercion).

Prefer Assert.prototype.strictEqual for most comparisons. Use Assert.prototype.notEqual for the inverse.

Examples

Example 1

assert.equal(1, 1);
assert.equal("1", 1, "loose equality allows coercion");

Parameters

actual: unknown

The value produced by the code under test.

expected: unknown

The expected value.

optional
message: string

Optional failure message.

Return Type

void

Usage

import { Assert } from ".";