Skip to content

Commit 53796bd

Browse files
author
George Adams
committed
reporter: update to use TAP 13
Use yamlish instead of # to match community: nodejs/node#9262
1 parent a7346e3 commit 53796bd

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

lib/reporter/tap.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ function generateTest(mod, count) {
1212
mod.error = mod.error.message;
1313
}
1414
var error = mod.error ? [directive, mod.error].join(' ') : '';
15-
var output = mod.testOutput ? '\n' + util.sanitizeOutput(mod.testOutput, '# ') : '';
15+
if (mod.testOutput && mod.testOutput.length > 0) {
16+
var output = '\n ---\n' + util.sanitizeOutput(mod.testOutput, ' #') + '\n ...';
17+
} else {
18+
output = '';
19+
}
1620
return [result, count + 1, '-', mod.name, 'v' + mod.version + error + output].join(' ');
1721
}
1822

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
TAP version 13
22
ok 1 - iPass v4.2.2
33
ok 2 - iFlakyFail v3.3.3 # SKIP I dun wurk
4-
# Thanks for testing!
4+
---
5+
# Thanks for testing!
6+
...
57
not ok 3 - iFail v3.0.1 I dun wurk
6-
# Thanks for testing!
8+
---
9+
# Thanks for testing!
10+
...
711
1..3

test/fixtures/test-out-tap-passing-append.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ This is a test!
22
TAP version 13
33
ok 1 - iPass v4.2.2
44
ok 2 - iFlakyPass v3.0.1
5-
# Thanks for testing!
5+
---
6+
# Thanks for testing!
7+
...
68
1..2
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
TAP version 13
22
ok 1 - iPass v4.2.2
33
ok 2 - iFlakyPass v3.0.1
4-
# Thanks for testing!
4+
---
5+
# Thanks for testing!
6+
...
57
1..2

0 commit comments

Comments
 (0)