forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a fullName getter to the TestContext and SuiteContext classes. This is similar to the existing name getter, but also includes the name of all ancestor tests/suites. PR-URL: nodejs#53169 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Co-authored-by: Jacob Smith <[email protected]>
- Loading branch information
1 parent
f168357
commit 66ccac2
Showing
3 changed files
with
50 additions
and
0 deletions.
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
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,24 @@ | ||
'use strict'; | ||
require('../common'); | ||
const { strictEqual } = require('node:assert'); | ||
const { suite, test } = require('node:test'); | ||
|
||
suite('suite', (t) => { | ||
strictEqual(t.fullName, 'suite'); | ||
|
||
test('test', (t) => { | ||
strictEqual(t.fullName, 'suite > test'); | ||
|
||
t.test('subtest', (t) => { | ||
strictEqual(t.fullName, 'suite > test > subtest'); | ||
|
||
t.test('subsubtest', (t) => { | ||
strictEqual(t.fullName, 'suite > test > subtest > subsubtest'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
test((t) => { | ||
strictEqual(t.fullName, '<anonymous>'); | ||
}); |