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
4 changes: 3 additions & 1 deletion lib/reporters/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import indentString from 'indent-string';
import plur from 'plur';
import * as supertap from 'supertap';

import serializeError from '../serialize-error.js';

import prefixTitle from './prefix-title.js';

function dumpError({
Expand Down Expand Up @@ -148,7 +150,7 @@ export default class TapReporter {

for (const [testFile, tests] of evt.pendingTests) {
for (const title of tests) {
this.writeTest({testFile, title, err: error}, {passed: false, todo: false, skip: false});
this.writeTest({testFile, title, err: serializeError(error)}, {passed: false, todo: false, skip: false});
}
}
}
Expand Down
1 change: 1 addition & 0 deletions test-tap/reporters/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ test(async t => {
t.test('tap reporter - second failFast run', run('failFast2'));
t.test('tap reporter - only run', run('only'));
t.test('tap reporter - edge cases', run('edgeCases'));
t.test('tap reporter - timeout', run('timeoutInSingleFile'));
});
27 changes: 27 additions & 0 deletions test-tap/reporters/tap.timeoutinsinglefile.v22.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
TAP version 13
---tty-stream-chunk-separator
ok 1 - passes
---tty-stream-chunk-separator
ok 2 - passes two
---tty-stream-chunk-separator
not ok 3 - slow
---
name: Error
message: Exited because no new tests completed within the last 2500ms of inactivity
at: 'TapReporter.writeTimeout (/lib/reporters/tap.js)'
...
---tty-stream-chunk-separator
not ok 4 - slow two
---
name: Error
message: Exited because no new tests completed within the last 2500ms of inactivity
at: 'TapReporter.writeTimeout (/lib/reporters/tap.js)'
...
---tty-stream-chunk-separator

1..4
# tests 4
# pass 2
# fail 2

---tty-stream-chunk-separator
27 changes: 27 additions & 0 deletions test-tap/reporters/tap.timeoutinsinglefile.v24.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
TAP version 13
---tty-stream-chunk-separator
ok 1 - passes
---tty-stream-chunk-separator
ok 2 - passes two
---tty-stream-chunk-separator
not ok 3 - slow
---
name: Error
message: Exited because no new tests completed within the last 2500ms of inactivity
at: 'TapReporter.writeTimeout (/lib/reporters/tap.js)'
...
---tty-stream-chunk-separator
not ok 4 - slow two
---
name: Error
message: Exited because no new tests completed within the last 2500ms of inactivity
at: 'TapReporter.writeTimeout (/lib/reporters/tap.js)'
...
---tty-stream-chunk-separator

1..4
# tests 4
# pass 2
# fail 2

---tty-stream-chunk-separator
27 changes: 27 additions & 0 deletions test-tap/reporters/tap.timeoutinsinglefile.v26.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
TAP version 13
---tty-stream-chunk-separator
ok 1 - passes
---tty-stream-chunk-separator
ok 2 - passes two
---tty-stream-chunk-separator
not ok 3 - slow
---
name: Error
message: Exited because no new tests completed within the last 2500ms of inactivity
at: 'TapReporter.writeTimeout (/lib/reporters/tap.js)'
...
---tty-stream-chunk-separator
not ok 4 - slow two
---
name: Error
message: Exited because no new tests completed within the last 2500ms of inactivity
at: 'TapReporter.writeTimeout (/lib/reporters/tap.js)'
...
---tty-stream-chunk-separator

1..4
# tests 4
# pass 2
# fail 2

---tty-stream-chunk-separator
Loading