Modules@robinpath/assert
@robinpath/assert
0.1.1PublicTesting 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
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
| Function | Description |
|---|---|
assert.equal | Assert two values are strictly equal (===) |
assert.notEqual | Assert two values are not equal |
assert.deepEqual | Assert deep equality of two values |
assert.truthy | Assert value is truthy |
assert.falsy | Assert value is falsy |
assert.isNull | Assert value is null or undefined |
assert.isNotNull | Assert value is not null/undefined |
assert.isType | Assert typeof value matches expected type |
assert.includes | Assert array/string includes a value |
assert.matches | Assert string matches a regex pattern |
assert.throws | Assert that a function throws |
assert.lengthOf | Assert array/string has specific length |
assert.hasProperty | Assert object has a specific property |
assert.isAbove | Assert number is above threshold |
assert.isBelow | Assert 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
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | yesterday |
Related Modules
utilities
1
@dev-tester/hello-world
v2.0.0dev-tester
Updated description
0 downloads
...
utilities
0
@robinpath/apollo
v0.1.1robinpath
Apollo module for RobinPath.
0 downloads
...
utilities
0
@robinpath/archive
v0.1.1robinpath
Create and extract .zip and .tar.gz file archives
0 downloads
...
utilities
0
@robinpath/barcode
v0.1.1robinpath
QR code generation, EAN/UPC barcode validation, ISBN conversion, and Luhn checksum
0 downloads
...
Install
$ robinpath install @robinpath/assert Version0.1.1
LicenseMIT
Unpacked Size4.8 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

