node package manager


Troop-based Node stubs

Node - Troop

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

Heavily incomplete.

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.

Mocking file reading:

var fs = require('fs');

    readFile: function (filename, callback) {
        callback(null, "file contents");

// do stuff that calls fs.readFile