Nightingale Posing Mischievously
Wondering what’s next for npm?Check out our public roadmap! »

@vangware/testTypeScript icon, indicating that this package has built-in type declarations

5.0.5 • Public • Published

@vangware/test

Build Status Coverage License NPM Version Open Issues Size

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:

@vangware/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

Documentation

Documentation can be found HERE. It is auto-generated with typedoc based on the JSDocs and the types in the source. Shouldn't be necessary to read this, code editors like VSCode integrate the documentation in the UI.

Changelog

Changelog can be found HERE.

Test coverage

Test coverage can be found HERE.

Install

npm i @vangware/test

DownloadsWeekly Downloads

25

Version

5.0.5

License

MIT

Unpacked Size

84.7 kB

Total Files

200

Last publish

Collaborators

  • avatar