Way back, a reader provided a clue as to how to run a single test. This is a good thing because none of the built-in test like scripts seem to do anything:
cstrom@whitefall:~/repos/fab$ node utils/test.jsWhat's worse is that the "core" test fails completely:
cstrom@whitefall:~/repos/fab$ node utils/build.js
cstrom@whitefall:~/repos/fab$ node builds/all.js
cstrom@whitefall:~/repos/fab$ node builds/core.jsBah!
Error: Cannot find module '/home/cstrom/repos/fab/apps/fab.Function'
at loadModule (node.js:492:15)
at require (node.js:618:12)
at Array.forEach (native)
at Object.<anonymous> (/home/cstrom/repos/fab/builds/core.js:12:41)
at Module._compile (node.js:639:23)
I can get that "working", in the sense that it does not crash, by adding a "defaults" object namespace to some of the apps in core.js:
var apps = exports.apps = [But that does me little good as running that file with node now returns right away without any output as well.
exports.app = require( "../utils/build" )( apps ).app;
Let's see if I can get a single test to run. Thanks to the comment from istruble, I know that I can create a
my_test.jsfile in the root directory of the fab.js source with contents like:
var test = require("./utils/test"),And indeed that does work:
target_module = require('./apps/fab.status');
cstrom@whitefall:~/repos/fab$ node my_test.jsI fiddle with that for a bit longer to see if I can get it to load in more tests automatically, but the overall approach feels very manual. I am forced to call it a night at this point. I think tomorrow I will move on to try Cucumber.
Running 3 tests...
Done. 3 passed, 0 failed.