dir-expect

Action

Performs inline assertions for testing Rhyme code. Use /expect for clean test syntax

Syntax

dir-expect $value equals "text"

check if variable equals text literal

dir-expect $value equals 42

check if variable equals number

dir-expect $value equals $expected

check if variable equals another variable

dir-expect $value exists

check if variable is defined

dir-expect $text contains "substring"

check if string contains substring

dir-expect $number gt 10

check if number is greater than value

dir-expect $number gte 10

check if number is greater than or equal to value

dir-expect $number less-than 10

check if number is less than value

dir-expect $number lte 10

check if number is less than or equal to value

dir-expect $value type "number"

check if variable is of specific type

dir-expect $text matches "pattern"

check if text matches regex pattern

dir-expect dom-text contains "text"

check if DOM text content contains string

dir-expect dom-text equals "text"

check if DOM text equals string

dir-expect $value not exists

check if variable does not exist

dir-expect $value equals 2025-01-15

check if variable equals date literal

dir-expect $array has-length 5

check if array/group has specific length

dir-expect $value equals true

check if variable equals boolean value

dir-expect $obj has-key "keyname"

check if object contains a specific key

dir-expect $obj key "keyname" is-true

check if object key value is truthy

dir-expect $obj key "keyname" is-false

check if object key value is falsy

dir-expect $obj key "keyname" equals "textvalue"

check if object key equals text value

dir-expect $obj key "keyname" equals 42

check if object key equals number value

Developer Reference
Set: unittest
Version: 0.0.0-23
Encoding: T_OP_S8
Actcode: 1293307510
Set ID: 112