Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
exports = module.exports = global;
var path = require('path');
QUnit = require(path.join(path.dirname(require.resolve('qunit-tap')), '..', 'vendor', 'qunit', 'qunit', 'qunit')).QUnit;
require("qunit-tap").qunitTap(QUnit, require("sys").puts, { noPlan: true });
QUnit.init();
QUnit.config.updateRate = 0;
exports.assert = QUnit;
require("../test_helper");
QUnit.module('Async Test Example');
QUnit.test('stop - start combo' , function() {
QUnit.stop(200);
setTimeout(function() {
assert.ok(true);
QUnit.start();
}, 100);
});
QUnit.asyncTest('asyncTest' , function() {
setTimeout(function() {
assert.ok(true);
QUnit.start();
}, 100);
});
QUnit.start();
$ npm ls installed qunit-tap
npm info it worked if it ends with ok
npm info using npm@0.3.17
npm info using node@v0.4.4
qunit-tap@1.0.0 active installed A TAP Output Producer Plugin for QUnit TDD QUnit test tests testing TAP
npm ok
$ prove --ext=.js --exec=node
t/hoge.js .. skipped: (no reason given)
Test Summary Report
-------------------
t/hoge.js (Wstat: 0 Tests: 1 Failed: 1)
Failed test: 1
Parse errors: Bad plan. You planned 0 tests but ran 1.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.06 cusr 0.01 csys = 0.09 CPU)
Result: FAIL
$ node t/hoge.js
# test: hoge
1..0
ok 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment