test_runner: add passed, attempt, and diagnostic to SuiteContext · nodejs/node@dd43eff · GitHub
Skip to content

Commit dd43eff

Browse files
MoLowaduh95
authored andcommitted
test_runner: add passed, attempt, and diagnostic to SuiteContext
PR-URL: #62504 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
1 parent 40ccfde commit dd43eff

3 files changed

Lines changed: 71 additions & 0 deletions

File tree

doc/api/test.md

Lines changed: 39 additions & 0 deletions

lib/internal/test_runner/test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,18 @@ class SuiteContext {
494494
get fullName() {
495495
return getFullName(this.#suite);
496496
}
497+
498+
get passed() {
499+
return this.#suite.passed;
500+
}
501+
502+
get attempt() {
503+
return this.#suite.attempt ?? 0;
504+
}
505+
506+
diagnostic(message) {
507+
this.#suite.diagnostic(message);
508+
}
497509
}
498510

499511
function parseExpectFailure(expectFailure) {

test/parallel/test-runner-test-fullname.js

Lines changed: 20 additions & 0 deletions

0 commit comments

Comments
 (0)