From 3a5fdacdc245890c6c0523098c42ca67d1c42cb2 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Fri, 26 Aug 2022 18:02:04 +0900 Subject: [PATCH] test: fix WPT runner result This doesn't include the other tests for the result when running a specific test in WPT. Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com PR-URL: https://github.com/nodejs/node/pull/44238 Reviewed-By: Luigi Pinca Reviewed-By: Filip Skokan Reviewed-By: Anto Aravinth --- test/common/wpt.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index 4d555e28a346ad..01f937fafce841 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -474,7 +474,6 @@ class WPTRunner { } process.on('exit', () => { - const total = this.specMap.size; if (this.inProgress.size > 0) { for (const filename of this.inProgress) { this.fail(filename, { name: 'Unknown' }, kIncomplete); @@ -506,7 +505,9 @@ class WPTRunner { } const unexpectedPasses = []; - for (const [key, specMap] of this.specMap) { + for (const specMap of queue) { + const key = specMap.filename; + // File has no expected failures if (!specMap.failedTests.length) { continue; @@ -529,7 +530,8 @@ class WPTRunner { } } - const ran = total - skipped; + const ran = queue.length; + const total = ran + skipped; const passed = ran - expectedFailures - failures.length; console.log(`Ran ${ran}/${total} tests, ${skipped} skipped,`, `${passed} passed, ${expectedFailures} expected failures,`,