Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ exports.test = function (name, start, options, callback) {
});

var test = {
name: name,
done: function (err) {
if (expecting !== undefined && expecting !== a_list.length) {
var e = new Error(
Expand Down
9 changes: 7 additions & 2 deletions test/test-runtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

var nodeunit = require('../lib/nodeunit'); // @REMOVE_LINE_FOR_BROWSER
var expectedName = 'testArgs';


exports.testArgs = function (test) {
Expand All @@ -13,15 +14,19 @@ exports.testArgs = function (test) {
test.ok(test.ok instanceof Function, 'test.ok');
test.ok(test.same instanceof Function, 'test.same');
test.ok(test.equals instanceof Function, 'test.equals');
test.equals(test.name, expectedName);
test.done();
};

exports.testDoneCallback = function (test) {
test.expect(4);
nodeunit.runTest('testname', exports.testArgs, {
var oldName = expectedName;
expectedName = 'testname';
nodeunit.runTest(expectedName, exports.testArgs, {
testDone: function (name, assertions) {
expectedName = oldName;
test.equals(assertions.failures(), 0, 'failures');
test.equals(assertions.length, 5, 'length');
test.equals(assertions.length, 6, 'length');
test.ok(typeof assertions.duration === "number");
test.equals(name, 'testname');
}
Expand Down