Skip to content

Instantly share code, notes, and snippets.

@aperiodic
Created August 1, 2011 22:17
Show Gist options
  • Save aperiodic/1119130 to your computer and use it in GitHub Desktop.
Save aperiodic/1119130 to your computer and use it in GitHub Desktop.
Vows Asynchronous Export Error
var assert = require('assert');
var exec = require('child_process').exec;
var vows = require('vows');
var exportTests = function () {
var batch = {
'When the tests are exported asynchronously': {
topic: function () { return 42; },
'they actually run': function (val) { assert.equal(val, 42); }
}
};
// export the tests
vows.describe('readability').addBatch(batch).export(module);
}
exec('sleep 1', function (err, stdout, stderr) {
if (err) throw(err);
exportTests();
});
@aperiodic
Copy link
Author

If run by node (i.e., node asyncExport.js), then the tests run normally. If run by vows, then the vows runner complains that it cannot find any tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment