bootstrapt
A quick way to set up TAP reporting
Last updated 5 years ago by ehealth .
MIT · Original npm · Tarball · package.json
$ cnpm install bootstrapt 
SYNC missed versions from official npm registry.

bootstrapt

A quick way to set up TAP reporting

Usage

From within whichever file will kick off your testing:

require('bootstrapt')({
    testDir: 'pathToTestFolder',
    specDir: 'specFolder' // Optional. Default is 'spec', eg. {testDir}/spec
});

How to define test files

bootstrapt will run through all the .js files in {testDir}/spec and run them through a TAP reporter.

This module is designed for testing Promise-based applications, where it is expected that the functionality you are testing returns promises, where tests would be written in a style similar to the following:

module.exports = function(test, Promise) {

    return getRecord()
    .then(function(rec) {

        test.ok(someTestAgainstRec);

        return updateUser()
    })
    .then(function(user) {

        test.ok(someTestAgainstUser);

        return ...
    });
};

If you will be writing tests where the above syntax is inappropriate, you need simply terminate your test specification with a resolved Promise:

module.exports = function(test, Promise) {

    test.equal(1,1);
    test.notEqual(1,0);

    return Promise.resolve();
};

You need not require a Promise library, as it will be provided for you (note function signature)

TODO

Add other reporters

Current Tags

  • 1.2.0                                ...           latest (5 years ago)

8 Versions

  • 1.2.0                                ...           5 years ago
  • 1.1.4                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 7
Dependencies (6)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |