Veve

Functions

assert Function

veve / assert

Function: assert()

assert(received): Assertion

Defined in: framework/Assertion.ts:968

Creates a new assertion instance for the provided value.

  • This function performs assertions that will throw an error if the condition fails.
  • Use this when you need hard failure handling for invalid conditions.

Parameters

received

any

The value to be asserted.

Returns

Assertion

An Assertion instance configured to throw errors on failure.

Example

assert(42).toBe(42); // Passes
assert("hello").toBe("world"); // Throws an error

On this page