From b10f69873cd29f48953c54e4691567d75ba74db2 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 8 Nov 2023 12:11:28 +0100 Subject: [PATCH] test: add WPT report test duration PR-URL: https://github.com/nodejs/node/pull/50574 Reviewed-By: Marco Ippolito Reviewed-By: Moshe Atlow Reviewed-By: Chengzhong Wu Reviewed-By: Yagiz Nizipli --- test/common/wpt.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/common/wpt.js b/test/common/wpt.js index 34436639dc3185..7d0b030614b003 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -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; } }