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

Asserts that state is truthy.

Examples

Example 1

assert.ok(true);
assert.ok(1, "non-zero is truthy");
assert.ok("hello");

Parameters

state: unknown

The value to test.

optional
message: string

Optional failure message.

Return Type

void

Usage

import { Assert } from ".";