Skip to content

Commit 9bbbcfe

Browse files
committed
[Fix] Results: show a skip string on tests, not just on assertions
1 parent 109a791 commit 9bbbcfe

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Diff for: lib/results.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,14 @@ Results.prototype._watch = function (t) {
184184

185185
t.once('prerun', function () {
186186
var premsg = '';
187+
var postmsg = '';
187188
if (t._skip) {
188189
premsg = 'SKIP ';
190+
postmsg = typeof t._skip === 'string' ? ' ' + coalesceWhiteSpaces(t._skip) : '';
189191
} else if (t._todo) {
190192
premsg = 'TODO ';
191193
}
192-
write('# ' + premsg + coalesceWhiteSpaces(t.name) + '\n');
194+
write('# ' + premsg + coalesceWhiteSpaces(t.name) + postmsg + '\n');
193195
});
194196

195197
t.on('result', function (res) {

Diff for: test/skip_explanation.js

+11
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ tap.test('test skip explanations', function (assert) {
2525
'ok 8 this runs',
2626
'# too much explanation',
2727
'ok 9 run openssl # SKIP Installer cannot work on windows and fails to add to PATH Err: (2401) denied',
28+
'# SKIP skipped subtest description!',
29+
'# SKIP this is a skipped test vs just an assertion skip description!',
2830
'',
2931
'1..9',
3032
'# tests 9',
@@ -78,8 +80,17 @@ tap.test('test skip explanations', function (assert) {
7880
'run openssl',
7981
{ skip: platform === 'win32' && 'Installer cannot work on windows\nand fails to add to PATH\n\n Err: (2401) denied' }
8082
);
83+
84+
t.test('skipped subtest', { skip: 'description!' }, function (st) {
85+
st.fail('does not run');
86+
});
87+
8188
t.end();
8289
});
90+
91+
tapeTest('this is a skipped test vs just an assertion', { skip: 'skip description!' }, function (t) {
92+
t.fail('does not run');
93+
});
8394
});
8495

8596
// vim: set softtabstop=4 shiftwidth=4:

0 commit comments

Comments
 (0)