or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

assert-interface.mdconfiguration.mdcore-assertions.mdexpect-interface.mdindex.mdplugin-system.mdshould-interface.mdutilities.md
tile.json

assert-interface.mddocs/

Assert Interface

TDD-style assertions providing standalone functions similar to Node.js assert module for direct validation. The assert interface offers a comprehensive set of functions for testing values, types, properties, and behaviors.

Capabilities

Core Assertion Function

Basic assertion function that tests an expression and throws if false.

/**
 * Basic assertion function that tests an expression
 * @param expression - Expression to test for truthiness
 * @param message - Error message if assertion fails
 * @throws AssertionError if expression is falsy
 */
function assert(expression: any, message?: string): void;

Failure Function

Explicit failure function for throwing assertion errors.

/**
 * Throws an assertion error with optional context
 * @param actual - The actual value (optional)
 * @param expected - The expected value (optional) 
 * @param message - Custom error message (optional)
 * @param operator - Comparison operator (optional)
 * @throws AssertionError
 */
assert.fail(actual?: any, expected?: any, message?: string, operator?: string): never;

Equality Assertions

Functions for testing various forms of equality between values.

/**
 * Non-strict equality assertion (==)
 * @param actual - Actual value
 * @param expected - Expected value
 * @param message - Optional error message
 */
assert.equal(actual: any, expected: any, message?: string): void;

/**
 * Non-strict inequality assertion (!=)
 * @param actual - Actual value  
 * @param expected - Expected value
 * @param message - Optional error message
 */
assert.notEqual(actual: any, expected: any, message?: string): void;

/**
 * Strict equality assertion (===)
 * @param actual - Actual value
 * @param expected - Expected value  
 * @param message - Optional error message
 */
assert.strictEqual(actual: any, expected: any, message?: string): void;

/**
 * Strict inequality assertion (!==)
 * @param actual - Actual value
 * @param expected - Expected value
 * @param message - Optional error message
 */
assert.notStrictEqual(actual: any, expected: any, message?: string): void;

/**
 * Deep equality assertion
 * @param actual - Actual value
 * @param expected - Expected value
 * @param message - Optional error message
 */
assert.deepEqual(actual: any, expected: any, message?: string): void;

/**
 * Deep inequality assertion
 * @param actual - Actual value
 * @param expected - Expected value
 * @param message - Optional error message
 */
assert.notDeepEqual(actual: any, expected: any, message?: string): void;

Truthiness Assertions

Functions for testing boolean values and truthiness.

/**
 * Tests that value is truthy
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isOk(value: any, message?: string): void;
assert.ok(value: any, message?: string): void; // Alias

/**
 * Tests that value is falsy
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotOk(value: any, message?: string): void;
assert.notOk(value: any, message?: string): void; // Alias

/**
 * Tests that value is strictly true
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isTrue(value: any, message?: string): void;

/**
 * Tests that value is not true
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotTrue(value: any, message?: string): void;

/**
 * Tests that value is strictly false
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isFalse(value: any, message?: string): void;

/**
 * Tests that value is not false
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotFalse(value: any, message?: string): void;

Null and Undefined Assertions

Functions for testing null, undefined, and existence.

/**
 * Tests that value is null
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNull(value: any, message?: string): void;

/**
 * Tests that value is not null
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotNull(value: any, message?: string): void;

/**
 * Tests that value is undefined
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isUndefined(value: any, message?: string): void;

/**
 * Tests that value is not undefined
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isDefined(value: any, message?: string): void;

/**
 * Tests that value is neither null nor undefined
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.exists(value: any, message?: string): void;

/**
 * Tests that value is null or undefined
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.notExists(value: any, message?: string): void;

Numeric Assertions

Functions for numeric comparisons and special number testing.

/**
 * Tests that value is above/greater than target
 * @param value - Value to test
 * @param target - Comparison target
 * @param message - Optional error message
 */
assert.isAbove(value: number, target: number, message?: string): void;

/**
 * Tests that value is at least/greater than or equal to target
 * @param value - Value to test
 * @param target - Comparison target
 * @param message - Optional error message
 */
assert.isAtLeast(value: number, target: number, message?: string): void;

/**
 * Tests that value is below/less than target
 * @param value - Value to test
 * @param target - Comparison target
 * @param message - Optional error message
 */
assert.isBelow(value: number, target: number, message?: string): void;

/**
 * Tests that value is at most/less than or equal to target
 * @param value - Value to test
 * @param target - Comparison target
 * @param message - Optional error message
 */
assert.isAtMost(value: number, target: number, message?: string): void;

/**
 * Tests that value is NaN
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNaN(value: any, message?: string): void;

/**
 * Tests that value is not NaN
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotNaN(value: any, message?: string): void;

/**
 * Tests that value is a finite number
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isFinite(value: number, message?: string): void;

/**
 * Tests numeric proximity within delta
 * @param actual - Actual value
 * @param expected - Expected value
 * @param delta - Maximum difference allowed
 * @param message - Optional error message
 */
assert.closeTo(actual: number, expected: number, delta: number, message?: string): void;
assert.approximately(actual: number, expected: number, delta: number, message?: string): void; // Alias

Type Assertions

Functions for testing JavaScript types and constructors.

/**
 * Tests that value is a callable function
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isCallable(value: any, message?: string): void;
assert.isFunction(value: any, message?: string): void; // Alias

/**
 * Tests that value is not a callable function
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotCallable(value: any, message?: string): void;
assert.isNotFunction(value: any, message?: string): void; // Alias

/**
 * Tests that value is an object (excluding null)
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isObject(value: any, message?: string): void;

/**
 * Tests that value is not an object
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotObject(value: any, message?: string): void;

/**
 * Tests that value is an array
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isArray(value: any, message?: string): void;

/**
 * Tests that value is not an array
 * @param value - Value to test
 * @param message - Optional error message  
 */
assert.isNotArray(value: any, message?: string): void;

/**
 * Tests that value is a string
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isString(value: any, message?: string): void;

/**
 * Tests that value is not a string
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotString(value: any, message?: string): void;

/**
 * Tests that value is a number
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNumber(value: any, message?: string): void;

/**
 * Tests that value is not a number
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotNumber(value: any, message?: string): void;

/**
 * Tests that value is numeric (number or BigInt)
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNumeric(value: any, message?: string): void;

/**
 * Tests that value is not numeric
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotNumeric(value: any, message?: string): void;

/**
 * Tests that value is a boolean
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isBoolean(value: any, message?: string): void;

/**
 * Tests that value is not a boolean
 * @param value - Value to test
 * @param message - Optional error message
 */
assert.isNotBoolean(value: any, message?: string): void;

/**
 * Tests that value's type matches expected type
 * @param value - Value to test
 * @param type - Expected type name
 * @param message - Optional error message
 */
assert.typeOf(value: any, type: string, message?: string): void;

/**
 * Tests that value's type does not match expected type
 * @param value - Value to test
 * @param type - Type name to reject
 * @param message - Optional error message
 */
assert.notTypeOf(value: any, type: string, message?: string): void;

/**
 * Tests that value is an instance of constructor
 * @param value - Value to test
 * @param constructor - Constructor function
 * @param message - Optional error message
 */
assert.instanceOf(value: any, constructor: Function, message?: string): void;

/**
 * Tests that value is not an instance of constructor
 * @param value - Value to test
 * @param constructor - Constructor function
 * @param message - Optional error message
 */
assert.notInstanceOf(value: any, constructor: Function, message?: string): void;

Function and Error Assertions

Functions for testing function behavior and exception throwing.

/**
 * Tests that function throws an error
 * @param fn - Function to test
 * @param errorLike - Expected error constructor or instance
 * @param errMsgMatcher - Expected error message (string or regex)
 * @param message - Optional assertion message
 * @returns The thrown error
 */
assert.throws(
  fn: Function, 
  errorLike?: Error | Function | string | RegExp, 
  errMsgMatcher?: string | RegExp, 
  message?: string
): Error;
assert.throw(fn: Function, errorLike?: any, errMsgMatcher?: any, message?: string): Error; // Alias
assert.Throw(fn: Function, errorLike?: any, errMsgMatcher?: any, message?: string): Error; // Alias

/**
 * Tests that function does not throw an error
 * @param fn - Function to test
 * @param errorLike - Error constructor or instance to reject
 * @param errMsgMatcher - Error message to reject (string or regex)
 * @param message - Optional assertion message
 */
assert.doesNotThrow(
  fn: Function, 
  errorLike?: Error | Function | string | RegExp, 
  errMsgMatcher?: string | RegExp, 
  message?: string
): void;

/**
 * Binary operator comparison
 * @param val1 - First value
 * @param operator - Comparison operator
 * @param val2 - Second value
 * @param message - Optional error message
 */
assert.operator(val1: any, operator: string, val2: any, message?: string): void;

String and Pattern Assertions

Functions for testing string content and pattern matching.

/**
 * Tests that string matches regular expression
 * @param value - String to test
 * @param pattern - Regular expression pattern
 * @param message - Optional error message
 */
assert.match(value: string, pattern: RegExp, message?: string): void;

/**
 * Tests that string does not match regular expression
 * @param value - String to test
 * @param pattern - Regular expression pattern
 * @param message - Optional error message
 */
assert.notMatch(value: string, pattern: RegExp, message?: string): void;

Property Assertions

Functions for testing object properties and values.

/**
 * Tests that object has property
 * @param obj - Object to test
 * @param property - Property name
 * @param message - Optional error message
 */
assert.property(obj: object, property: string, message?: string): void;

/**
 * Tests that object does not have property
 * @param obj - Object to test
 * @param property - Property name
 * @param message - Optional error message
 */
assert.notProperty(obj: object, property: string, message?: string): void;

/**
 * Tests that object has property with specific value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Expected property value
 * @param message - Optional error message
 */
assert.propertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object property does not have specific value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Value to reject
 * @param message - Optional error message
 */
assert.notPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object has property with deep equal value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Expected property value (deep comparison)
 * @param message - Optional error message
 */
assert.deepPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object property is not deep equal to value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Value to reject (deep comparison)
 * @param message - Optional error message
 */
assert.notDeepPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object has own property (not inherited)
 * @param obj - Object to test
 * @param property - Property name
 * @param message - Optional error message
 */
assert.ownProperty(obj: object, property: string, message?: string): void;

/**
 * Tests that object does not have own property
 * @param obj - Object to test
 * @param property - Property name
 * @param message - Optional error message
 */
assert.notOwnProperty(obj: object, property: string, message?: string): void;

/**
 * Tests that object has own property with specific value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Expected property value
 * @param message - Optional error message
 */
assert.ownPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object's own property does not have specific value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Value to reject
 * @param message - Optional error message
 */
assert.notOwnPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object has own property with deep equal value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Expected property value (deep comparison)
 * @param message - Optional error message
 */
assert.deepOwnPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object's own property is not deep equal to value
 * @param obj - Object to test
 * @param property - Property name
 * @param value - Value to reject (deep comparison)
 * @param message - Optional error message
 */
assert.notDeepOwnPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object has nested property using dot/bracket notation
 * @param obj - Object to test
 * @param property - Property path (e.g., "a.b[0].c")
 * @param message - Optional error message
 */
assert.nestedProperty(obj: object, property: string, message?: string): void;

/**
 * Tests that object does not have nested property
 * @param obj - Object to test
 * @param property - Property path
 * @param message - Optional error message
 */
assert.notNestedProperty(obj: object, property: string, message?: string): void;

/**
 * Tests that object has nested property with specific value
 * @param obj - Object to test
 * @param property - Property path
 * @param value - Expected property value
 * @param message - Optional error message
 */
assert.nestedPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object's nested property does not have specific value
 * @param obj - Object to test
 * @param property - Property path
 * @param value - Value to reject
 * @param message - Optional error message
 */
assert.notNestedPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object has nested property with deep equal value
 * @param obj - Object to test
 * @param property - Property path
 * @param value - Expected property value (deep comparison)
 * @param message - Optional error message
 */
assert.deepNestedPropertyVal(obj: object, property: string, value: any, message?: string): void;

/**
 * Tests that object's nested property is not deep equal to value
 * @param obj - Object to test
 * @param property - Property path
 * @param value - Value to reject (deep comparison)
 * @param message - Optional error message
 */
assert.notDeepNestedPropertyVal(obj: object, property: string, value: any, message?: string): void;

Collection and Array Assertions

Functions for testing arrays, sets, and other collections.

/**
 * Tests that object/array has specific length
 * @param obj - Object or array to test
 * @param length - Expected length
 * @param message - Optional error message
 */
assert.lengthOf(obj: any, length: number, message?: string): void;

/**
 * Tests that object/array includes specific value
 * @param haystack - Collection to search in
 * @param needle - Value to search for
 * @param message - Optional error message
 */
assert.include(haystack: any, needle: any, message?: string): void;

/**
 * Tests that object/array does not include specific value
 * @param haystack - Collection to search in
 * @param needle - Value to search for
 * @param message - Optional error message
 */
assert.notInclude(haystack: any, needle: any, message?: string): void;

/**
 * Tests that object/array deeply includes specific value
 * @param haystack - Collection to search in
 * @param needle - Value to search for (deep comparison)
 * @param message - Optional error message
 */
assert.deepInclude(haystack: any, needle: any, message?: string): void;

/**
 * Tests that object/array does not deeply include specific value
 * @param haystack - Collection to search in
 * @param needle - Value to search for (deep comparison)
 * @param message - Optional error message
 */
assert.notDeepInclude(haystack: any, needle: any, message?: string): void;

/**
 * Tests nested inclusion using dot/bracket notation
 * @param haystack - Object to search in
 * @param needle - Value to search for with nested path
 * @param message - Optional error message
 */
assert.nestedInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests nested non-inclusion using dot/bracket notation
 * @param haystack - Object to search in
 * @param needle - Value to search for with nested path
 * @param message - Optional error message
 */
assert.notNestedInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests deep nested inclusion
 * @param haystack - Object to search in
 * @param needle - Value to search for with nested path (deep comparison)
 * @param message - Optional error message
 */
assert.deepNestedInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests deep nested non-inclusion
 * @param haystack - Object to search in
 * @param needle - Value to search for with nested path (deep comparison)
 * @param message - Optional error message
 */
assert.notDeepNestedInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests own inclusion (ignoring inherited properties)
 * @param haystack - Object to search in
 * @param needle - Value to search for
 * @param message - Optional error message
 */
assert.ownInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests own non-inclusion
 * @param haystack - Object to search in
 * @param needle - Value to search for
 * @param message - Optional error message
 */
assert.notOwnInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests deep own inclusion
 * @param haystack - Object to search in
 * @param needle - Value to search for (deep comparison, own properties only)
 * @param message - Optional error message
 */
assert.deepOwnInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests deep own non-inclusion
 * @param haystack - Object to search in
 * @param needle - Value to search for (deep comparison, own properties only)
 * @param message - Optional error message
 */
assert.notDeepOwnInclude(haystack: object, needle: object, message?: string): void;

/**
 * Tests that value is one of the provided options
 * @param value - Value to test
 * @param list - Array of valid options
 * @param message - Optional error message
 */
assert.oneOf(value: any, list: any[], message?: string): void;

/**
 * Tests that value is iterable
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isIterable(obj: any, message?: string): void;

/**
 * Tests that object is empty (length 0, no enumerable properties)
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isEmpty(obj: any, message?: string): void;

/**
 * Tests that object is not empty
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isNotEmpty(obj: any, message?: string): void;

Key Assertions

Functions for testing object keys and key sets.

/**
 * Tests that object has any of the provided keys
 * @param obj - Object to test
 * @param keys - Array of key names
 * @param message - Optional error message
 */
assert.hasAnyKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object has all of the provided keys
 * @param obj - Object to test
 * @param keys - Array of key names
 * @param message - Optional error message
 */
assert.hasAllKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object contains all of the provided keys (may have additional keys)
 * @param obj - Object to test
 * @param keys - Array of key names
 * @param message - Optional error message
 */
assert.containsAllKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object does not have any of the provided keys
 * @param obj - Object to test
 * @param keys - Array of key names
 * @param message - Optional error message
 */
assert.doesNotHaveAnyKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object does not have all of the provided keys
 * @param obj - Object to test
 * @param keys - Array of key names
 * @param message - Optional error message
 */
assert.doesNotHaveAllKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object has any of the provided keys (deep comparison)
 * @param obj - Object to test
 * @param keys - Array of key values for deep comparison
 * @param message - Optional error message
 */
assert.hasAnyDeepKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object has all of the provided keys (deep comparison)
 * @param obj - Object to test
 * @param keys - Array of key values for deep comparison
 * @param message - Optional error message
 */
assert.hasAllDeepKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object contains all of the provided keys (deep comparison)
 * @param obj - Object to test
 * @param keys - Array of key values for deep comparison
 * @param message - Optional error message
 */
assert.containsAllDeepKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object does not have any of the provided keys (deep comparison)
 * @param obj - Object to test
 * @param keys - Array of key values for deep comparison
 * @param message - Optional error message
 */
assert.doesNotHaveAnyDeepKeys(obj: object, keys: any[], message?: string): void;

/**
 * Tests that object does not have all of the provided keys (deep comparison)
 * @param obj - Object to test
 * @param keys - Array of key values for deep comparison
 * @param message - Optional error message
 */
assert.doesNotHaveAllDeepKeys(obj: object, keys: any[], message?: string): void;

Member Assertions

Functions for testing array and set membership with various comparison modes.

/**
 * Tests that arrays have same members (order doesn't matter)
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.sameMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that arrays do not have same members
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.notSameMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that arrays have same members using deep equality
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.sameDeepMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that arrays do not have same members using deep equality
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.notSameDeepMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that arrays have same members in same order
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.sameOrderedMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that arrays do not have same members in same order
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.notSameOrderedMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that arrays have same members in same order using deep equality
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.sameDeepOrderedMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that arrays do not have same members in same order using deep equality
 * @param set1 - First array
 * @param set2 - Second array
 * @param message - Optional error message
 */
assert.notSameDeepOrderedMembers(set1: any[], set2: any[], message?: string): void;

/**
 * Tests that superset includes all members of subset
 * @param superset - Array that should contain all subset members
 * @param subset - Array of members to check for
 * @param message - Optional error message
 */
assert.includeMembers(superset: any[], subset: any[], message?: string): void;

/**
 * Tests that superset does not include all members of subset
 * @param superset - Array to check
 * @param subset - Array of members that should not all be present
 * @param message - Optional error message
 */
assert.notIncludeMembers(superset: any[], subset: any[], message?: string): void;

/**
 * Tests that superset includes all members of subset using deep equality
 * @param superset - Array that should contain all subset members
 * @param subset - Array of members to check for (deep comparison)
 * @param message - Optional error message
 */
assert.includeDeepMembers(superset: any[], subset: any[], message?: string): void;

/**
 * Tests that superset does not include all members of subset using deep equality
 * @param superset - Array to check
 * @param subset - Array of members that should not all be present (deep comparison)
 * @param message - Optional error message
 */
assert.notIncludeDeepMembers(superset: any[], subset: any[], message?: string): void;

/**
 * Tests that superset includes all members of subset in same order
 * @param superset - Array that should contain subset in order
 * @param subset - Array of ordered members to check for
 * @param message - Optional error message
 */
assert.includeOrderedMembers(superset: any[], subset: any[], message?: string): void;

/**
 * Tests that superset does not include all members of subset in same order
 * @param superset - Array to check
 * @param subset - Array of ordered members
 * @param message - Optional error message
 */
assert.notIncludeOrderedMembers(superset: any[], subset: any[], message?: string): void;

/**
 * Tests that superset includes all members of subset in same order using deep equality
 * @param superset - Array that should contain subset in order
 * @param subset - Array of ordered members to check for (deep comparison)
 * @param message - Optional error message
 */
assert.includeDeepOrderedMembers(superset: any[], subset: any[], message?: string): void;

/**
 * Tests that superset does not include all members of subset in same order using deep equality
 * @param superset - Array to check
 * @param subset - Array of ordered members (deep comparison)
 * @param message - Optional error message
 */
assert.notIncludeDeepOrderedMembers(superset: any[], subset: any[], message?: string): void;

Function State Change Assertions

Functions for testing how function calls affect object properties.

/**
 * Tests that function changes object property value
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param message - Optional error message
 */
assert.changes(fn: Function, obj: object, property: string, message?: string): void;

/**
 * Tests that function changes object property value by specific amount
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param delta - Expected change amount
 * @param message - Optional error message
 */
assert.changesBy(fn: Function, obj: object, property: string, delta: number, message?: string): void;

/**
 * Tests that function does not change object property value
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param message - Optional error message
 */
assert.doesNotChange(fn: Function, obj: object, property: string, message?: string): void;

/**
 * Tests that function changes property value but not by specific amount
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param delta - Change amount to reject
 * @param message - Optional error message
 */
assert.changesButNotBy(fn: Function, obj: object, property: string, delta: number, message?: string): void;

/**
 * Tests that function increases object property value
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param message - Optional error message
 */
assert.increases(fn: Function, obj: object, property: string, message?: string): void;

/**
 * Tests that function increases object property value by specific amount
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param delta - Expected increase amount
 * @param message - Optional error message
 */
assert.increasesBy(fn: Function, obj: object, property: string, delta: number, message?: string): void;

/**
 * Tests that function does not increase object property value
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param message - Optional error message
 */
assert.doesNotIncrease(fn: Function, obj: object, property: string, message?: string): void;

/**
 * Tests that function increases property value but not by specific amount
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param delta - Increase amount to reject
 * @param message - Optional error message
 */
assert.increasesButNotBy(fn: Function, obj: object, property: string, delta: number, message?: string): void;

/**
 * Tests that function decreases object property value
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param message - Optional error message
 */
assert.decreases(fn: Function, obj: object, property: string, message?: string): void;

/**
 * Tests that function decreases object property value by specific amount
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param delta - Expected decrease amount
 * @param message - Optional error message
 */
assert.decreasesBy(fn: Function, obj: object, property: string, delta: number, message?: string): void;

/**
 * Tests that function does not decrease object property value
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param message - Optional error message
 */
assert.doesNotDecrease(fn: Function, obj: object, property: string, message?: string): void;

/**
 * Tests that function does not decrease object property by specific amount
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param delta - Decrease amount to reject
 * @param message - Optional error message
 */
assert.doesNotDecreaseBy(fn: Function, obj: object, property: string, delta: number, message?: string): void;

/**
 * Tests that function decreases property value but not by specific amount
 * @param fn - Function to execute
 * @param obj - Object to monitor
 * @param property - Property name to monitor
 * @param delta - Decrease amount to reject
 * @param message - Optional error message
 */
assert.decreasesButNotBy(fn: Function, obj: object, property: string, delta: number, message?: string): void;

Object State Assertions

Functions for testing object extensibility, sealing, and freezing states.

/**
 * Tests that object is extensible (new properties can be added)
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isExtensible(obj: object, message?: string): void;

/**
 * Tests that object is not extensible
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isNotExtensible(obj: object, message?: string): void;

/**
 * Tests that object is sealed (properties cannot be added/removed but can be modified)
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isSealed(obj: object, message?: string): void;

/**
 * Tests that object is not sealed
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isNotSealed(obj: object, message?: string): void;

/**
 * Tests that object is frozen (properties cannot be added/removed/modified)
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isFrozen(obj: object, message?: string): void;

/**
 * Tests that object is not frozen
 * @param obj - Object to test
 * @param message - Optional error message
 */
assert.isNotFrozen(obj: object, message?: string): void;

Subset and Error Assertions

Additional utility assertions for subsets and error conditions.

/**
 * Tests that actual contains all properties and values of expected (subset match)
 * @param actual - Object to test
 * @param expected - Expected subset of properties
 * @param message - Optional error message
 */
assert.containsSubset(actual: object, expected: object, message?: string): void;

/**
 * Tests that actual does not contain all properties and values of expected
 * @param actual - Object to test
 * @param expected - Subset to reject
 * @param message - Optional error message
 */
assert.doesNotContainSubset(actual: object, expected: object, message?: string): void;

/**
 * Tests that value is falsy and throws if it's an Error instance
 * Compatible with Node.js assert.ifError
 * @param value - Value to test
 */
assert.ifError(value: any): void;

Usage Examples:

import { assert } from "chai";

// Basic assertions
assert(true, "Should be truthy");
assert.equal(2 + 2, 4);
assert.strictEqual("hello", "hello");
assert.deepEqual({ a: 1 }, { a: 1 });

// Type testing
assert.isString("hello");
assert.isNumber(42);
assert.isArray([1, 2, 3]);
assert.isObject({ name: "test" });

// Numeric comparisons
assert.isAbove(5, 3);
assert.isAtLeast(5, 5);
assert.closeTo(1.5, 1.6, 0.2);

// Function testing
assert.throws(() => { throw new Error("test"); });
assert.throws(() => { throw new Error("test"); }, Error);
assert.throws(() => { throw new Error("specific message"); }, /specific/);
assert.doesNotThrow(() => { return 42; });

// Binary operations
assert.operator(1, "<", 2);
assert.operator("a", "===", "a");

// Property testing
assert.property({ name: "Alice" }, "name");
assert.propertyVal({ age: 25 }, "age", 25);
assert.nestedProperty({ user: { name: "Bob" } }, "user.name");

// Collection testing
assert.include([1, 2, 3], 2);
assert.lengthOf("hello", 5);
assert.sameMembers([1, 2, 3], [3, 2, 1]);

// State change testing
let counter = 0;
assert.changes(() => { counter++; }, { get count() { return counter; } }, "count");

// Object state testing
const obj = {};
assert.isExtensible(obj);
Object.seal(obj);
assert.isSealed(obj);