Modules@robinpath/assert

@robinpath/assert

0.1.1Public

Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more

@robinpath/assert

Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more

Category Functions Auth License

Why use this module?

The assert module lets you:

  • Assert two values are strictly equal (===)
  • Assert two values are not equal
  • Assert deep equality of two values
  • Assert value is truthy
  • Assert value is falsy

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/assert

Quick Start

No credentials needed — start using it right away:

assert.notEqual $a $b

Available Functions

FunctionDescription
assert.equalAssert two values are strictly equal (===)
assert.notEqualAssert two values are not equal
assert.deepEqualAssert deep equality of two values
assert.truthyAssert value is truthy
assert.falsyAssert value is falsy
assert.isNullAssert value is null or undefined
assert.isNotNullAssert value is not null/undefined
assert.isTypeAssert typeof value matches expected type
assert.includesAssert array/string includes a value
assert.matchesAssert string matches a regex pattern
assert.throwsAssert that a function throws
assert.lengthOfAssert array/string has specific length
assert.hasPropertyAssert object has a specific property
assert.isAboveAssert number is above threshold
assert.isBelowAssert number is below threshold

Examples

Assert two values are not equal

assert.notEqual $a $b

Assert deep equality of two values

assert.deepEqual $obj1 $obj2

Assert value is truthy

assert.truthy $val

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/assert";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  assert.notEqual $a $b
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.1latestyesterday
Install
$ robinpath install @robinpath/assert
Version0.1.1
LicenseMIT
Unpacked Size4.8 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities