universal-tester

0.1.1 • Public • Published

Universal Tester

Create a simple test report for node js

Installation

npm i universal-tester

Usage

const Tester = require('universal-tester');
let tester = new Tester();

test(functionOutput, expectedOutput, functionName)

Add tests to tester class

functionOutput - output of the function

expectedOutput - expected output of the function

functionName - name of the function

function helloWorld(){
  return 'Hello, World!';
}

tester.test(helloWorld(), 'Hello, World!', 'helloWorld');

printResults()

Prints test results. For passed tests, "PASSED" is printed with the test number and function that was run. For failed tests, "FAILED" is printed with test number, function name, as well as the outputs.

Test 1 (helloWorld)  PASSED


1/1 tests passed

Readme

Keywords

none

Package Sidebar

Install

npm i universal-tester

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

2.8 kB

Total Files

3

Last publish

Collaborators

  • ttse76