2.1.7 • Published 8 years ago

hi-test v2.1.7

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

HI-TEST

Simple test framework on Nodejs

FEATURES

  1. It's very simple. This is all

INSTALLATION

$ npm install hi-test

USAGE

COMMAND

Usage:
    hi-test <files> [-d] [-a] [-f <title>]
Options:
    +scan <path>            Scan module exports
    -f, --filter <title>    Filter the output
    -d, --debug             Display all output
    -a, --auto              Automation
    -v, --version           Display version
    -h, --help              Display help

API

  • test(title, hash, func) Start a test, if the func is async function, then the test call done

  • test.enable() If enable, the unprotected output will be masked

  • test.enableGC() Enable node --expose-gc
  • test.log(...args)
  • test.gc(obj, desc) Test obj release
  • class Tester
    • Tester.prototype.log(...args)
    • Tester.prototype.logp(...args) More detailed output
    • Tester.prototype.warn(...args)
    • Tester.prototype.error(...args)
    • Tester.prototype.gc(obj, desc)
    • Tester.prototype.run(func) Non-blocking execution
    • Tester.prototype.done() This method is automatic call

EXAMPLE

var test = require('hi-test').enable().enableGC();

let arr = [1, 2, 3];

test('No.1', (t) => {
    t.log('Hello, Iam No.1');
    t.gc(arr);
});

test('No.2', (t) => {
    t.log('Hello, Iam No.2');
    t.gc(arr);
    arr = null;
});

Non-blocking

var test = require('hi-test').enable();

test('No.1').run((t) => {
    setTimeout(() => {
        t.log('Hello, Iam No.1');
    }, 1000);
});

test('No.2').run((t) => {
    t.log('Hello, Iam No.2');
});
2.1.7

8 years ago

2.1.6

8 years ago

2.1.5

8 years ago

2.1.4

8 years ago

2.1.3

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago