Skip to content

Commit

Permalink
other test
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Aug 10, 2023
1 parent ed7b52a commit 60c0edc
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/fixtures/test-runner/output/async-test-scheduling.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as common from '../../../common/index.mjs';
import { describe, test } from 'node:test';
import { setTimeout } from 'node:timers/promises';

test('test', common.mustCall());
describe('suite', common.mustCall(async () => {
test('test', common.mustCall());
await setTimeout(10);
test('scheduled async', common.mustCall());
}));

await setTimeout(10);
test('scheduled async', common.mustCall());
37 changes: 37 additions & 0 deletions test/fixtures/test-runner/output/async-test-scheduling.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
TAP version 13
# Subtest: test
ok 1 - test
---
duration_ms: *
...
# Subtest: suite
# Subtest: test
ok 1 - test
---
duration_ms: *
...
# Subtest: scheduled async
ok 2 - scheduled async
---
duration_ms: *
...
1..2
ok 2 - suite
---
duration_ms: *
type: 'suite'
...
# Subtest: scheduled async
ok 3 - scheduled async
---
duration_ms: *
...
1..3
# tests 4
# suites 1
# pass 4
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms *
1 change: 1 addition & 0 deletions test/parallel/test-runner-output.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const tests = [
{ name: 'test-runner/output/unresolved_promise.js' },
{ name: 'test-runner/output/default_output.js', transform: specTransform, tty: true },
{ name: 'test-runner/output/arbitrary-output.js' },
{ name: 'test-runner/output/async-test-scheduling.mjs' },
!skipForceColors ? {
name: 'test-runner/output/arbitrary-output-colored.js',
transform: snapshot.transform(specTransform, replaceTestDuration), tty: true
Expand Down

0 comments on commit 60c0edc

Please sign in to comment.