Socket
Book a DemoInstallSign in
Socket

micro-test

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-test

An asynchronous unit testing framework in under 40 lines of code.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Node Micro Test

MicroTest is an asynchronous testing framework built for Node.js. It's under 40 lines of code, and has no dependencies.

Usage

Create a folder called test/ in the root of your project directory.

Within this folder create .js testing files that look like this:

var equal = require('assert').equal;

exports.tests = {
	'true should be equal to true': function(finished, prefix) {
		equal(true, true, prefix + " that's weird, true should really be equal to true.");
		setTimeout(function() {
			finished();
		}, 2000);
	}
};
  • finished call this within your test, to indicate that all asynchronous actions have completed.
  • prefix contextual information about the test that you can print out with your assertions.

CLI

Just run the command micro-test from the root directory of your Node.js project.

  • npm install micro-test
  • micro-test

Copyright (c) 2012 Attachments.me. See LICENSE.txt for further details.

Keywords

unit

FAQs

Package last updated on 24 Feb 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts