mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: add WPT report test duration
PR-URL: https://github.com/nodejs/node/pull/50574 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
1 parent
4cbe44ed6f
commit
6ed8fbf612
1 file changed
+4
@@ -59,10 +59,13 @@ function codeUnitStr(char) {
|
||||
}
|
||||
|
||||
class ReportResult {
|
||||
#startTime;
|
||||
|
||||
constructor(name) {
|
||||
this.test = name;
|
||||
this.status = 'OK';
|
||||
this.subtests = [];
|
||||
this.#startTime = Date.now();
|
||||
}
|
||||
|
||||
addSubtest(name, status, message) {
|
||||
@@ -81,6 +84,7 @@ class ReportResult {
|
||||
|
||||
finish(status) {
|
||||
this.status = status ?? 'OK';
|
||||
this.duration = Date.now() - this.#startTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user