| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,6 +71,10 @@ class TapStream extends Readable { | |||
| 71 | 71 | return `TODO${reason ? ` ${tapEscape(reason)}` : ''}`; | |
| 72 | 72 | } | |
| 73 | 73 | ||
| 74 | + subtest(indent, name) { | ||
| 75 | + this.#tryPush(`${indent}# Subtest: ${tapEscape(name)}\n`); | ||
| 76 | + } | ||
| 77 | + | ||
| 74 | 78 | details(indent, duration, error) { | |
| 75 | 79 | let details = `${indent} ---\n`; | |
| 76 | 80 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,6 +183,10 @@ class Test extends AsyncResource { | |||
| 183 | 183 | return; | |
| 184 | 184 | } | |
| 185 | 185 | ||
| 186 | + if (i === 1 && this.parent !== null) { | ||
| 187 | + this.reporter.subtest(this.indent, this.name); | ||
| 188 | + } | ||
| 189 | + | ||
| 186 | 190 | // Report the subtest's results and remove it from the ready map. | |
| 187 | 191 | subtest.finalize(); | |
| 188 | 192 | this.readySubtests.delete(i); | |
@@ -416,6 +420,8 @@ class Test extends AsyncResource { | |||
| 416 | 420 | // Output this test's results and update the parent's waiting counter. | |
| 417 | 421 | if (this.subtests.length > 0) { | |
| 418 | 422 | this.reporter.plan(this.subtests[0].indent, this.subtests.length); | |
| 423 | + } else { | ||
| 424 | + this.reporter.subtest(this.indent, this.name); | ||
| 419 | 425 | } | |
| 420 | 426 | ||
| 421 | 427 | this.report(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,6 @@ | |||
| 1 | 1 | TAP version 13 | |
| 2 | + # Subtest: does not keep event loop alive | ||
| 3 | + # Subtest: +does not keep event loop alive | ||
| 2 | 4 | not ok 1 - +does not keep event loop alive | |
| 3 | 5 | --- | |
| 4 | 6 | duration_ms: * | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,76 +1,97 @@ | |||
| 1 | 1 | TAP version 13 | |
| 2 | + # Subtest: only = undefined | ||
| 2 | 3 | ok 1 - only = undefined # SKIP 'only' option not set | |
| 3 | 4 | --- | |
| 4 | 5 | duration_ms: * | |
| 5 | 6 | ... | |
| 7 | + # Subtest: only = undefined, skip = string | ||
| 6 | 8 | ok 2 - only = undefined, skip = string # SKIP 'only' option not set | |
| 7 | 9 | --- | |
| 8 | 10 | duration_ms: * | |
| 9 | 11 | ... | |
| 12 | + # Subtest: only = undefined, skip = true | ||
| 10 | 13 | ok 3 - only = undefined, skip = true # SKIP 'only' option not set | |
| 11 | 14 | --- | |
| 12 | 15 | duration_ms: * | |
| 13 | 16 | ... | |
| 17 | + # Subtest: only = undefined, skip = false | ||
| 14 | 18 | ok 4 - only = undefined, skip = false # SKIP 'only' option not set | |
| 15 | 19 | --- | |
| 16 | 20 | duration_ms: * | |
| 17 | 21 | ... | |
| 22 | + # Subtest: only = false | ||
| 18 | 23 | ok 5 - only = false # SKIP 'only' option not set | |
| 19 | 24 | --- | |
| 20 | 25 | duration_ms: * | |
| 21 | 26 | ... | |
| 27 | + # Subtest: only = false, skip = string | ||
| 22 | 28 | ok 6 - only = false, skip = string # SKIP 'only' option not set | |
| 23 | 29 | --- | |
| 24 | 30 | duration_ms: * | |
| 25 | 31 | ... | |
| 32 | + # Subtest: only = false, skip = true | ||
| 26 | 33 | ok 7 - only = false, skip = true # SKIP 'only' option not set | |
| 27 | 34 | --- | |
| 28 | 35 | duration_ms: * | |
| 29 | 36 | ... | |
| 37 | + # Subtest: only = false, skip = false | ||
| 30 | 38 | ok 8 - only = false, skip = false # SKIP 'only' option not set | |
| 31 | 39 | --- | |
| 32 | 40 | duration_ms: * | |
| 33 | 41 | ... | |
| 42 | + # Subtest: only = true, skip = string | ||
| 34 | 43 | ok 9 - only = true, skip = string # SKIP skip message | |
| 35 | 44 | --- | |
| 36 | 45 | duration_ms: * | |
| 37 | 46 | ... | |
| 47 | + # Subtest: only = true, skip = true | ||
| 38 | 48 | ok 10 - only = true, skip = true # SKIP | |
| 39 | 49 | --- | |
| 40 | 50 | duration_ms: * | |
| 41 | 51 | ... | |
| 52 | + # Subtest: only = true, with subtests | ||
| 53 | + # Subtest: running subtest 1 | ||
| 42 | 54 | ok 1 - running subtest 1 | |
| 43 | 55 | --- | |
| 44 | 56 | duration_ms: * | |
| 45 | 57 | ... | |
| 58 | + # Subtest: running subtest 2 | ||
| 46 | 59 | ok 2 - running subtest 2 | |
| 47 | 60 | --- | |
| 48 | 61 | duration_ms: * | |
| 49 | 62 | ... | |
| 63 | + # Subtest: skipped subtest 1 | ||
| 50 | 64 | ok 3 - skipped subtest 1 # SKIP 'only' option not set | |
| 51 | 65 | --- | |
| 52 | 66 | duration_ms: * | |
| 53 | 67 | ... | |
| 68 | + # Subtest: skipped subtest 2 | ||
| 54 | 69 | ok 4 - skipped subtest 2 # SKIP 'only' option not set | |
| 55 | 70 | --- | |
| 56 | 71 | duration_ms: * | |
| 57 | 72 | ... | |
| 73 | + # Subtest: running subtest 3 | ||
| 58 | 74 | ok 5 - running subtest 3 | |
| 59 | 75 | --- | |
| 60 | 76 | duration_ms: * | |
| 61 | 77 | ... | |
| 78 | + # Subtest: running subtest 4 | ||
| 79 | + # Subtest: running sub-subtest 1 | ||
| 62 | 80 | ok 1 - running sub-subtest 1 | |
| 63 | 81 | --- | |
| 64 | 82 | duration_ms: * | |
| 65 | 83 | ... | |
| 84 | + # Subtest: running sub-subtest 2 | ||
| 66 | 85 | ok 2 - running sub-subtest 2 | |
| 67 | 86 | --- | |
| 68 | 87 | duration_ms: * | |
| 69 | 88 | ... | |
| 89 | + # Subtest: skipped sub-subtest 1 | ||
| 70 | 90 | ok 3 - skipped sub-subtest 1 # SKIP 'only' option not set | |
| 71 | 91 | --- | |
| 72 | 92 | duration_ms: * | |
| 73 | 93 | ... | |
| 94 | + # Subtest: skipped sub-subtest 2 | ||
| 74 | 95 | ok 4 - skipped sub-subtest 2 # SKIP 'only' option not set | |
| 75 | 96 | --- | |
| 76 | 97 | duration_ms: * | |
@@ -80,10 +101,12 @@ ok 10 - only = true, skip = true # SKIP | |||
| 80 | 101 | --- | |
| 81 | 102 | duration_ms: * | |
| 82 | 103 | ... | |
| 104 | + # Subtest: skipped subtest 3 | ||
| 83 | 105 | ok 7 - skipped subtest 3 # SKIP 'only' option not set | |
| 84 | 106 | --- | |
| 85 | 107 | duration_ms: * | |
| 86 | 108 | ... | |
| 109 | + # Subtest: skipped subtest 4 | ||
| 87 | 110 | ok 8 - skipped subtest 4 # SKIP | |
| 88 | 111 | --- | |
| 89 | 112 | duration_ms: * | |
| Back | FazBrowse Home | New Git URL |
0 commit comments