Neutral Point Measurement
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

whew

1.1.3 • Public • Published

whew

A simple, pretty, and lightweight Node.JS testing framework

whew - Downloads Total whew - Version whew - License whew - Github Stars


whew demonstration

Installation

npm install whew

Or, for distribution with your package...

npm install whew --save

Simple usage

cosnt w = require("whew");
 
w.add("This works.", (res) => {
    res(true, "See?");
});
 
w.add("Adding numbers", (res) => {
    // Hopefull this one will pass also...
    var added = 3 + 4;
    res((added === 7), "Resulted in 3 + 4 = " + added);
});
 
w.add("My bad", (res) => {
    // Let's pretend something went wrong here.
    res(false, "I've failed you!");
});
 
w.test();

API: Really quick explanation

I'll explain how this works as quickly as possible so you can get right to testing.

First, of course, we require the library.

const w = require("whew");

Then we create a test.

w.add("Test name", (res) => {
    res(true, "Optional description here"); // This one will pass with the description!
});

The callback method provided to the test can be called with the following parameters:

  • Passed? Boolean
  • Description String Optional

Then, of course, we actually execute the tests.

w.test();

Simple, isn't it?

Simple demo: Multi-file testing

It's crazy simple to keep your tests organized within multiple files. Here's a demo...

test.js (Main test file)

const w = require("whew");
 
w.add("Adding numbers", require("./addingNumbersTest.js"));
 
w.test();

addingNumbersTest.js

module.exports = (res) => {
    res(true, "Hey, it worked!");
};

install

npm i whew

Downloadsweekly downloads

33

version

1.1.3

license

SEE LICENSE IN LICENSE.md

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability