Skip to content

Commit

Permalink
fix tests for real
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Jun 14, 2022
1 parent ab9de5c commit 4bca978
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ class Test extends AsyncResource {
}

start() {
this.reporter.subTest(this.indent, this.name);
// If there is enough available concurrency to run the test now, then do
// it. Otherwise, return a Promise to the caller and mark the test as
// pending for later execution.
Expand All @@ -296,6 +295,7 @@ class Test extends AsyncResource {
}

async run() {
this.reporter.subTest(this.indent, this.name);
this.parent.activeSubtests++;
this.startTime = hrtime();

Expand Down
2 changes: 2 additions & 0 deletions test/message/test_runner_no_refs.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
TAP version 13
# Subtest: does not keep event loop alive
# Subtest: +does not keep event loop alive
not ok 1 - +does not keep event loop alive
---
duration_ms: *
Expand Down
23 changes: 23 additions & 0 deletions test/message/test_runner_only_tests.out
Original file line number Diff line number Diff line change
@@ -1,76 +1,97 @@
TAP version 13
# Subtest: only = undefined
ok 1 - only = undefined # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = undefined, skip = string
ok 2 - only = undefined, skip = string # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = undefined, skip = true
ok 3 - only = undefined, skip = true # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = undefined, skip = false
ok 4 - only = undefined, skip = false # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = false
ok 5 - only = false # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = false, skip = string
ok 6 - only = false, skip = string # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = false, skip = true
ok 7 - only = false, skip = true # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = false, skip = false
ok 8 - only = false, skip = false # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: only = true, skip = string
ok 9 - only = true, skip = string # SKIP skip message
---
duration_ms: *
...
# Subtest: only = true, skip = true
ok 10 - only = true, skip = true # SKIP
---
duration_ms: *
...
# Subtest: only = true, with subtests
# Subtest: running subtest 1
ok 1 - running subtest 1
---
duration_ms: *
...
# Subtest: running subtest 2
ok 2 - running subtest 2
---
duration_ms: *
...
# Subtest: skipped subtest 1
ok 3 - skipped subtest 1 # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: skipped subtest 2
ok 4 - skipped subtest 2 # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: running subtest 3
ok 5 - running subtest 3
---
duration_ms: *
...
# Subtest: running subtest 4
# Subtest: running sub-subtest 1
ok 1 - running sub-subtest 1
---
duration_ms: *
...
# Subtest: running sub-subtest 2
ok 2 - running sub-subtest 2
---
duration_ms: *
...
# Subtest: skipped sub-subtest 1
ok 3 - skipped sub-subtest 1 # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: skipped sub-subtest 2
ok 4 - skipped sub-subtest 2 # SKIP 'only' option not set
---
duration_ms: *
Expand All @@ -80,10 +101,12 @@ ok 10 - only = true, skip = true # SKIP
---
duration_ms: *
...
# Subtest: skipped subtest 3
ok 7 - skipped subtest 3 # SKIP 'only' option not set
---
duration_ms: *
...
# Subtest: skipped subtest 4
ok 8 - skipped subtest 4 # SKIP
---
duration_ms: *
Expand Down
Loading

0 comments on commit 4bca978

Please sign in to comment.