@satisfactory-dev/custom-assert
v0.2.3
Published
Custom Assert functions used by @satisfactory-dev/docs.json.ts
Downloads
20
Readme
Development
Requirements
- Docker
- recommend vscode devcontainer support
- phpstorm's devcontainer support works but doesn't seem as capable
Instructions
- Checkout locally
- Load in devcontainer-supporting IDE
- devcontainer setup should automatically run
make install
NODE_OPTIONS
env var may require opening a fresh terminal if you receieve an error along the lines ofTypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
- devcontainer setup should automatically run
Usage
- run
npm install --save @satisfactory-dev/custom-assert
- integrate with testing solution
Example
Taken from project tests
import {describe, it} from 'node:test';
import assert from 'node:assert/strict';
import {array_has_size} from '@satisfactory-dev/custom-assert';
void describe('array_has_size', () => {
void it('does not throw', () => {
assert.doesNotThrow(() => array_has_size([], 0));
assert.doesNotThrow(() => array_has_size(['foo'], 1));
});
void it('does throw', () => {
assert.throws(() => array_has_size([], 1));
assert.throws(() => array_has_size([1], 0));
});
});