method Assert.prototype.true
Assert.prototype.true(
state: unknown,
message?: string
): void

Asserts that state === true (strict boolean true).

Examples

Example 1

assert.true(1 === 1);
assert.true(Array.isArray([]), "arrays are arrays");

Parameters

state: unknown

The value to test.

optional
message: string

Optional failure message.

Return Type

void

Usage

import { Assert } from ".";