forked from nodejs/node
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
TAP version 13 | ||
# Subtest: this should pass | ||
ok 1 - this should pass | ||
--- | ||
duration_ms: | ||
... | ||
1..1 | ||
# tests 1 | ||
# pass 1 | ||
# fail 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
TAP version 13 | ||
# Subtest: $FILE_PATH | ||
ok 1 - $FILE_PATH | ||
--- | ||
duration_ms: | ||
... | ||
1..1 | ||
# tests 1 | ||
# pass 1 | ||
# fail 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
const test = require('node:test'); | ||
|
||
test('level 1', async (t) => { | ||
await t.test('level 2.1', async (t) => { | ||
await t.test('level 3', () => {}); | ||
}); | ||
await t.test('level 2.2', async (t) => { | ||
await t.test('level 3', () => {}); | ||
}); | ||
await t.test('level 2.4', () => {}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
TAP version 13 | ||
# Subtest: level 1 | ||
# Subtest: level 2.1 | ||
# Subtest: level 3 | ||
ok 1 - level 3 | ||
--- | ||
duration_ms: | ||
... | ||
1..1 | ||
ok 1 - level 2.1 | ||
--- | ||
duration_ms: | ||
... | ||
# Subtest: level 2.2 | ||
# Subtest: level 3 | ||
ok 1 - level 3 | ||
--- | ||
duration_ms: | ||
... | ||
1..1 | ||
ok 2 - level 2.2 | ||
--- | ||
duration_ms: | ||
... | ||
# Subtest: level 2.4 | ||
ok 3 - level 2.4 | ||
--- | ||
duration_ms: | ||
... | ||
1..3 | ||
ok 1 - level 1 | ||
--- | ||
duration_ms: | ||
... | ||
1..1 | ||
# tests 1 | ||
# pass 1 | ||
# fail 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms: |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'use strict'; | ||
const test = require('node:test'); | ||
|
||
test('this should pass'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
require('../common'); | ||
const assert = require('assert'); | ||
const { spawnSync } = require('child_process'); | ||
const fixtures = require('../common/fixtures'); | ||
|
||
function removeDuration(str) { | ||
return str.replace(/duration_ms:? .+/g, 'duration_ms: '); | ||
} | ||
|
||
{ | ||
// sanity | ||
const child = spawnSync(process.execPath, [fixtures.path('test-runner/index.test.js')]); | ||
const stdout = removeDuration(child.stdout.toString()); | ||
const expected = fixtures.readSync('test-runner/index.test.tap').toString(); | ||
|
||
assert.strictEqual(stdout, expected); | ||
} | ||
{ | ||
// nested tests | ||
const child = spawnSync(process.execPath, [fixtures.path('test-runner/nested.test.js')]); | ||
const stdout = removeDuration(child.stdout.toString()); | ||
const expected = fixtures.readSync('test-runner/nested.test.tap').toString(); | ||
|
||
assert.strictEqual(stdout, expected); | ||
} | ||
{ | ||
// using test runner cli | ||
const file = fixtures.path('test-runner/nested.test.js'); | ||
const child = spawnSync(process.execPath, ['--test', fixtures.path('test-runner/nested.test.js')]); | ||
const stdout = removeDuration(child.stdout.toString()); | ||
const expected = fixtures.readSync('test-runner/nested.test.cli.tap').toString().replace(/\$FILE_PATH/g, file); | ||
|
||
assert.strictEqual(stdout, expected); | ||
} |