mirror of
https://github.com/denoland/deno.git
synced 2024-12-15 11:58:42 -05:00
a526cff0a9
This PR adds a test reporter for the [Test Anything Protocol](https://testanything.org). It makes the following implementation decisions: - No TODO pragma, as there is no such marker in `Deno.test` - SKIP pragma for `ignore`d tests - Test steps are treated as TAP14 subtests - Support for this in consumers seems spotty - Some consumers will incorrectly interpret these markers, resulting in unexpected output - Considering the lack of support, and to avoid implementation complexity, subtests are at most one level deep (all test steps are in the same subtest) - To accommodate consumers that use comments to indicate test-suites (unspecced) - The test module path is output as a comment - This is disabled for `--parallel` testing - Failure diagnostics are output as JSON, which is also valid YAML - The structure is not specified, so the format roughly follows the spec example: ``` --- message: "Failed with error 'hostname peebles.example.com not found'" severity: fail found: hostname: 'peebles.example.com' address: ~ wanted: hostname: 'peebles.example.com' address: '85.193.201.85' at: file: test/dns-resolve.c line: 142 ... ```
42 lines
1.1 KiB
Text
42 lines
1.1 KiB
Text
TAP version 14
|
|
# ./test/steps/passing_steps.ts
|
|
# Subtest: description
|
|
ok 1 - inner 1
|
|
ok 2 - inner 2
|
|
ok 3 - step 1
|
|
1..3
|
|
ok 1 - description
|
|
# Subtest: description function as first arg
|
|
ok 1 - inner1
|
|
ok 2 - inner1
|
|
ok 3 - step1
|
|
1..3
|
|
ok 2 - description function as first arg
|
|
# Subtest: parallel steps without sanitizers
|
|
ok 1 - step 1
|
|
ok 2 - step 2
|
|
1..2
|
|
ok 3 - parallel steps without sanitizers
|
|
# Subtest: parallel steps without sanitizers due to parent
|
|
ok 1 - step 1
|
|
ok 2 - step 2
|
|
1..2
|
|
ok 4 - parallel steps without sanitizers due to parent
|
|
# Subtest: steps with disabled sanitizers, then enabled, then parallel disabled
|
|
ok 1 - step 2
|
|
ok 2 - step 1
|
|
ok 3 - step 1
|
|
ok 4 - step 1
|
|
ok 5 - step 1
|
|
ok 6 - step 1
|
|
1..6
|
|
ok 5 - steps with disabled sanitizers, then enabled, then parallel disabled
|
|
# Subtest: steps buffered then streaming reporting
|
|
ok 1 - step 1 - 2 - 1
|
|
ok 2 - step 1 - 2
|
|
ok 3 - step 1 - 1
|
|
ok 4 - step 1
|
|
ok 5 - step 2
|
|
1..5
|
|
ok 6 - steps buffered then streaming reporting
|
|
1..6
|