1.1.0 • Published 2 years ago

kreszentia v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version npm downloads

Contents

Installing

Using npm:

$ npm install kreszentia --global

Getting Started

$ npm install kreszentia --global
$ mkdir __tests__ && cd __tests__
$ touch addition.js

In your editor:

import { equal } from "node:assert";

// Define a new suite
suite("addition", () => {
	 // Add a new test
	add("add 1+1", () => {
		equal(1  +  1,  3);
	});
	
	 // Add a new test
	add("add 2+2", () => {
		equal(2  +  2,  4);
	});
	
	// Finish adding tests
	done();
});

 // Runs all suites.
run();

In the terminal:

$ kreszentia
addition:
    ✕ - add 1+1: expected 3, got 2
    ✓ - add 2+2

1 tests passing, 1 tests failing

As of version 1.1.0. kreszentia also supports require()/import:

const { suite, add, done, run } = require("kreszentia");

Or:

import { suite, add, done, run } from "kreszentia";

API

suite(suiteName, callback)

Creates a new test suite.

suiteNamestring
callbackfunction

add(testName, callback)

Adds a test to the current test suite.

testNamestring
callbackfunction

done()

Finish adding tests to the test suite.

run()

Run all suites.

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago