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:
Filip Skokan authored and Michaël Zasso committed 2023-11-14 09:17:58 +01:00
1 parent 4cbe44ed6f
commit 6ed8fbf612
1 file changed
+4
+4
View File
@@ -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;
}
}