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

@vangware/test

2.0.1 • Public • Published

@vangware/test

License NPM Version Open Issues Size

Wrapper of uvu that enforces legibility (based on RITEway).

Usage

import { test } from "@vangware/test"; // or: import test from "@vangware/test";
 
const add = (addend2: number) => (addend1: number) => addend1 + addend2;
 
test([
    {
        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
    }
]);

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

[FAIL] Given a 1 and a 2, must return 3.
    ++3    (Expected)
    --4    (Actual)

Install

npm i @vangware/[email protected]

Version

2.0.1

License

MIT

Unpacked Size

11.7 kB

Total Files

24

Last publish

Collaborators

  • avatar