This package has been deprecated

Author message:

Use proxy methods with on-demand require instead

node-troop

0.2.0 • Public • Published

Node - Troop

Troop-based stubs for testing server side code with browser-based tools such as jsTestDriver.

Heavily incomplete.

Usage

Make sure troop.testing = true; is applied before managing mock methods.

Default methods have been included for convenience. You may add mock methods for functions that are not implemented on the stub.

Example

Mocking file reading:

var fs = require('fs');

fs.addMocks({
    readFile: function (filename, callback) {
        callback(null, "file contents");
    }
});

// do stuff that calls fs.readFile

fs.removeMocks();

Package Sidebar

Install

npm i node-troop

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • danstocker-legacy