Miss any of our Open RFC calls?Watch the recordings here! »

@vangware/test

4.0.7 • Public • Published

@vangware/test

License NPM Version Open Issues Size

Simple equality test with enforced legibility (based on RITEway and inspired by uvu).

Usage

Write:

import { suite } from "@vangware/test";
 
const add = (addend2: number) => (addend1: number) => addend1 + addend2;
 
export default suite([
    {
        given: "a 1 and a 2",
        must: "return 3",
        received: add(2)(1),
        wanted: 3
    },
    {
        given: "a 1 and a -2",
        must: "return -1",
        received: add(-2)(1),
        wanted: -1
    }
])("Example suite name (optional)");

Then run:

test

If let's say the first test fails, the error reads something like this:

[FAIL] Example suite name (optional)

> Given a 1 and a 2, must return 3.

Received: 4
Wanted:   3

Install

npm i @vangware/test

DownloadsWeekly Downloads

204

Version

4.0.7

License

MIT

Unpacked Size

72.7 kB

Total Files

180

Last publish

Collaborators

  • avatar