GeezerVison is showing github.com — test_runner: apply `runOnly` on suites · nodejs/node@44411fc
File treeExpand file treeCollapse file tree Open diff view settings test/fixtures/test-runner/output
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/internal/test_runner/test.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -759,6 +759,8 @@ class Suite extends Test { | 759 | 759 | constructor(options) { | 760 | 760 | super(options); | 761 | 761 |
| | 762 | + this.runOnlySubtests = testOnlyFlag; | | 763 | + | 762 | 764 | try { | 763 | 765 | const { ctx, args } = this.getRunArgs(); | 764 | 766 | const runArgs = [this.fn, ctx]; | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/only_tests.js +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -48,9 +48,9 @@ test('only = true, with subtests', { only: true }, async (t) => { | 48 | 48 | }); | 49 | 49 |
| 50 | 50 | describe.only('describe only = true, with subtests', () => { | 51 | | - it('`it` subtest 1 should run', () => {}); | | 51 | + it.only('`it` subtest 1 should run', () => {}); | 52 | 52 |
| 53 | | - it('`it` subtest 2 should run', async () => {}); | | 53 | + it('`it` subtest 2 should not run', async () => {}); | 54 | 54 | }); | 55 | 55 |
| 56 | 56 | describe.only('describe only = true, with a mixture of subtests', () => { | @@ -92,9 +92,9 @@ describe.only('describe only = true, with a mixture of subtests', () => { | 92 | 92 | }); | 93 | 93 |
| 94 | 94 | describe.only('describe only = true, with subtests', () => { | 95 | | - test('subtest should run', () => {}); | | 95 | + test.only('subtest should run', () => {}); | 96 | 96 |
| 97 | | - test('async subtest should run', async () => {}); | | 97 | + test('async subtest should not run', async () => {}); | 98 | 98 |
| 99 | 99 | test('subtest should be skipped', { only: false }, () => {}); | 100 | 100 | }); |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/only_tests.snapshot +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -122,8 +122,8 @@ ok 11 - only = true, with subtests | 122 | 122 | --- | 123 | 123 | duration_ms: * | 124 | 124 | ... | 125 | | - # Subtest: `it` subtest 2 should run | 126 | | - ok 2 - `it` subtest 2 should run | | 125 | + # Subtest: `it` subtest 2 should not run | | 126 | + ok 2 - `it` subtest 2 should not run # SKIP 'only' option not set | 127 | 127 | --- | 128 | 128 | duration_ms: * | 129 | 129 | ... | @@ -155,7 +155,7 @@ ok 12 - describe only = true, with subtests | 155 | 155 | duration_ms: * | 156 | 156 | ... | 157 | 157 | # Subtest: `it` subtest 3 skip | 158 | | - ok 5 - `it` subtest 3 skip # SKIP | | 158 | + ok 5 - `it` subtest 3 skip # SKIP 'only' option not set | 159 | 159 | --- | 160 | 160 | duration_ms: * | 161 | 161 | ... | @@ -185,7 +185,7 @@ ok 12 - describe only = true, with subtests | 185 | 185 | duration_ms: * | 186 | 186 | ... | 187 | 187 | # Subtest: `test` subtest 3 skip | 188 | | - ok 11 - `test` subtest 3 skip # SKIP | | 188 | + ok 11 - `test` subtest 3 skip # SKIP 'only' option not set | 189 | 189 | --- | 190 | 190 | duration_ms: * | 191 | 191 | ... | @@ -206,8 +206,8 @@ ok 13 - describe only = true, with a mixture of subtests | 206 | 206 | --- | 207 | 207 | duration_ms: * | 208 | 208 | ... | 209 | | - # Subtest: async subtest should run | 210 | | - ok 2 - async subtest should run | | 209 | + # Subtest: async subtest should not run | | 210 | + ok 2 - async subtest should not run # SKIP 'only' option not set | 211 | 211 | --- | 212 | 212 | duration_ms: * | 213 | 213 | ... | @@ -225,9 +225,9 @@ ok 14 - describe only = true, with subtests | 225 | 225 | 1..14 | 226 | 226 | # tests 40 | 227 | 227 | # suites 3 | 228 | | -# pass 17 | | 228 | +# pass 15 | 229 | 229 | # fail 0 | 230 | 230 | # cancelled 0 | 231 | | -# skipped 23 | | 231 | +# skipped 25 | 232 | 232 | # todo 0 | 233 | 233 | # duration_ms * |
|