-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: #53169 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Co-authored-by: Jacob Smith <jacob@frende.me>
- Loading branch information
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>'); | ||
}); |