Skip to content

satisfactory-dev/Custom-Assert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coverage Status Workflow Status

Development

Requirements

  • Docker
    • recommend vscode devcontainer support
    • phpstorm's devcontainer support works but doesn't seem as capable

Instructions

  1. Checkout locally
  2. 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 of TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"

Usage

  1. run npm install --save @satisfactory-dev/custom-assert
  2. 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));
	});
});

License

see LICENSE.md

About

Custom Assert functions used by @satisfactory-clips-archive/docs.json.ts

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published