Skip to content

Commit 4d63927

Browse files
author
Eric Millin
committed
Comment formatting review fixes
1 parent c878a3a commit 4d63927

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lib/test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ Test.prototype.test = function (name, opts, cb) {
107107
});
108108
};
109109

110-
Test.prototype.comment = function () {
110+
Test.prototype.comment = function (msg) {
111111
var that = this;
112-
var keys = Object.keys(arguments)
113-
var msg = keys.length > 1 ? format.apply(null, arguments) : arguments[keys[0]];
112+
113+
msg = arguments.length > 1 ? format.apply(null, arguments) : msg;
114114

115115
trim(msg).split('\n').forEach(function (aMsg) {
116116
that.emit('result', trim(aMsg).replace(/^#\s*/, ''));

readme.markdown

+1-2
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ You may pass the same options that [`test()`](#testname-opts-cb) accepts.
273273

274274
## t.comment(message[, ...])
275275

276-
Print a message without breaking the tap output. Accepts optional args for `util.format`-style formatting.
277-
(Useful when using e.g. `tap-colorize` where output is buffered & `console.log` will print in incorrect order vis-a-vis tap output.)
276+
Print a message without breaking the tap output. Accepts optional args for `util.format`-style formatting. Useful when using e.g. `tap-colorize` where output is buffered & `console.log` will print in incorrect order vis-a-vis tap output.
278277

279278
## var htest = test.createHarness()
280279

test/comment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,4 @@ tap.test('formatted multiline string', function (assert) {
226226
t.comment("tip\n%s\nt%s", "tap", "ape");
227227
t.end();
228228
});
229-
});
229+
});

0 commit comments

Comments
 (0)