Skip to content

Commit

Permalink
Upgrade supertap and print t.log entries according to TAP diagnosti…
Browse files Browse the repository at this point in the history
…cs spec

Co-authored-by: Daudov, Tymur <tymur.daudov@f-secure.com>
Co-authored-by: Mark Wubben <mark@novemberborn.net>
  • Loading branch information
3 people committed Dec 23, 2020
1 parent 5d3b200 commit 99ab93a
Show file tree
Hide file tree
Showing 23 changed files with 219 additions and 346 deletions.
2 changes: 1 addition & 1 deletion lib/reporters/tap.js
Expand Up @@ -125,7 +125,7 @@ class TapReporter {
this.reportStream.write(`# ${stripAnsi(title)}${os.EOL}`);
if (evt.logs) {
for (const log of evt.logs) {
const logLines = indentString(log, 4).replace(/^ {4}/, ' # ');
const logLines = indentString(log, 4).replace(/^ {4}/gm, '# ');
this.reportStream.write(`${logLines}${os.EOL}`);
}
}
Expand Down
105 changes: 69 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -106,7 +106,7 @@
"source-map-support": "^0.5.19",
"stack-utils": "^2.0.3",
"strip-ansi": "^6.0.0",
"supertap": "^1.0.0",
"supertap": "^2.0.0",
"temp-dir": "^2.0.0",
"trim-off-newlines": "^1.0.1",
"update-notifier": "^5.0.1",
Expand Down
6 changes: 0 additions & 6 deletions test-tap/reporters/tap.edgecases.v10.log
@@ -1,9 +1,7 @@
TAP version 13
---tty-stream-chunk-separator
# No tests found in ava-import-no-test-declaration.js
not ok 1 - No tests found in ava-import-no-test-declaration.js
---tty-stream-chunk-separator
# TypeError: test is not a function
not ok 2 - TypeError: test is not a function
---
name: TypeError
Expand All @@ -13,21 +11,17 @@ not ok 2 - TypeError: test is not a function
(test-tap/fixture/report/edgecases/import-and-use-test-member.js:3:1)
...
---tty-stream-chunk-separator
# import-and-use-test-member.js exited with a non-zero exit code: 1
not ok 3 - import-and-use-test-member.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator
# No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
not ok 4 - No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
---tty-stream-chunk-separator
# Error: throws
not ok 5 - Error: throws
---
name: Error
message: throws
at: 'Object.<anonymous> (test-tap/fixture/report/edgecases/throws.js:1:7)'
...
---tty-stream-chunk-separator
# throws.js exited with a non-zero exit code: 1
not ok 6 - throws.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator

Expand Down
6 changes: 0 additions & 6 deletions test-tap/reporters/tap.edgecases.v12.log
@@ -1,9 +1,7 @@
TAP version 13
---tty-stream-chunk-separator
# No tests found in ava-import-no-test-declaration.js
not ok 1 - No tests found in ava-import-no-test-declaration.js
---tty-stream-chunk-separator
# TypeError: test is not a function
not ok 2 - TypeError: test is not a function
---
name: TypeError
Expand All @@ -13,21 +11,17 @@ not ok 2 - TypeError: test is not a function
(test-tap/fixture/report/edgecases/import-and-use-test-member.js:3:1)
...
---tty-stream-chunk-separator
# import-and-use-test-member.js exited with a non-zero exit code: 1
not ok 3 - import-and-use-test-member.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator
# No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
not ok 4 - No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
---tty-stream-chunk-separator
# Error: throws
not ok 5 - Error: throws
---
name: Error
message: throws
at: 'Object.<anonymous> (test-tap/fixture/report/edgecases/throws.js:1:7)'
...
---tty-stream-chunk-separator
# throws.js exited with a non-zero exit code: 1
not ok 6 - throws.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator

Expand Down
6 changes: 0 additions & 6 deletions test-tap/reporters/tap.edgecases.v14.log
@@ -1,9 +1,7 @@
TAP version 13
---tty-stream-chunk-separator
# No tests found in ava-import-no-test-declaration.js
not ok 1 - No tests found in ava-import-no-test-declaration.js
---tty-stream-chunk-separator
# TypeError: test is not a function
not ok 2 - TypeError: test is not a function
---
name: TypeError
Expand All @@ -13,21 +11,17 @@ not ok 2 - TypeError: test is not a function
(test-tap/fixture/report/edgecases/import-and-use-test-member.js:3:1)
...
---tty-stream-chunk-separator
# import-and-use-test-member.js exited with a non-zero exit code: 1
not ok 3 - import-and-use-test-member.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator
# No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
not ok 4 - No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
---tty-stream-chunk-separator
# Error: throws
not ok 5 - Error: throws
---
name: Error
message: throws
at: 'Object.<anonymous> (test-tap/fixture/report/edgecases/throws.js:1:7)'
...
---tty-stream-chunk-separator
# throws.js exited with a non-zero exit code: 1
not ok 6 - throws.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator

Expand Down
6 changes: 0 additions & 6 deletions test-tap/reporters/tap.edgecases.v15.log
@@ -1,9 +1,7 @@
TAP version 13
---tty-stream-chunk-separator
# No tests found in ava-import-no-test-declaration.js
not ok 1 - No tests found in ava-import-no-test-declaration.js
---tty-stream-chunk-separator
# TypeError: test is not a function
not ok 2 - TypeError: test is not a function
---
name: TypeError
Expand All @@ -13,21 +11,17 @@ not ok 2 - TypeError: test is not a function
(test-tap/fixture/report/edgecases/import-and-use-test-member.js:3:1)
...
---tty-stream-chunk-separator
# import-and-use-test-member.js exited with a non-zero exit code: 1
not ok 3 - import-and-use-test-member.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator
# No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
not ok 4 - No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file
---tty-stream-chunk-separator
# Error: throws
not ok 5 - Error: throws
---
name: Error
message: throws
at: 'Object.<anonymous> (test-tap/fixture/report/edgecases/throws.js:1:7)'
...
---tty-stream-chunk-separator
# throws.js exited with a non-zero exit code: 1
not ok 6 - throws.js exited with a non-zero exit code: 1
---tty-stream-chunk-separator

Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast.v10.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast.v12.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast.v14.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast.v15.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast2.v10.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast2.v12.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast2.v14.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
3 changes: 1 addition & 2 deletions test-tap/reporters/tap.failfast2.v15.log
@@ -1,7 +1,6 @@
TAP version 13
---tty-stream-chunk-separator
# a › fails
not ok 1 - a › fails
not ok 1 - a › fails
---
name: AssertionError
message: Test failed via `t.fail()`
Expand Down
6 changes: 2 additions & 4 deletions test-tap/reporters/tap.only.v10.log
@@ -1,10 +1,8 @@
TAP version 13
---tty-stream-chunk-separator
# a › only
ok 1 - a › only
ok 1 - a › only
---tty-stream-chunk-separator
# b › passes
ok 2 - b › passes
ok 2 - b › passes
---tty-stream-chunk-separator

1..2
Expand Down
6 changes: 2 additions & 4 deletions test-tap/reporters/tap.only.v12.log
@@ -1,10 +1,8 @@
TAP version 13
---tty-stream-chunk-separator
# a › only
ok 1 - a › only
ok 1 - a › only
---tty-stream-chunk-separator
# b › passes
ok 2 - b › passes
ok 2 - b › passes
---tty-stream-chunk-separator

1..2
Expand Down
6 changes: 2 additions & 4 deletions test-tap/reporters/tap.only.v14.log
@@ -1,10 +1,8 @@
TAP version 13
---tty-stream-chunk-separator
# a › only
ok 1 - a › only
ok 1 - a › only
---tty-stream-chunk-separator
# b › passes
ok 2 - b › passes
ok 2 - b › passes
---tty-stream-chunk-separator

1..2
Expand Down

0 comments on commit 99ab93a

Please sign in to comment.