diff options
author | cjihrig <cjihrig@gmail.com> | 2023-03-05 11:57:44 -0500 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2023-04-10 20:55:11 -0400 |
commit | 3b077a688576a312c665dde6a751f78c5f162c46 (patch) | |
tree | 735c239a246fb4d794760722692ba5c049414c2b | |
parent | 15503ffd12da34c4fd814ec42c94f534081d96a4 (diff) | |
download | node-new-3b077a688576a312c665dde6a751f78c5f162c46.tar.gz |
test_runner: remove root tracking set
The wasRootSetup Set in the test harness appears to be
redundant, since the startTime field can be used interchangeably.
This commit removes wasRootSetup.
PR-URL: https://github.com/nodejs/node/pull/46961
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
-rw-r--r-- | lib/internal/test_runner/harness.js | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/internal/test_runner/harness.js b/lib/internal/test_runner/harness.js index 95715769a3..748edd9fa2 100644 --- a/lib/internal/test_runner/harness.js +++ b/lib/internal/test_runner/harness.js @@ -2,7 +2,6 @@ const { ArrayPrototypeForEach, SafeMap, - SafeWeakSet, } = primordials; const { createHook, @@ -23,7 +22,6 @@ const { const { bigint: hrtime } = process.hrtime; const testResources = new SafeMap(); -const wasRootSetup = new SafeWeakSet(); function createTestTree(options = kEmptyObject) { return setup(new Test({ __proto__: null, ...options, name: '<root>' })); @@ -102,7 +100,7 @@ function collectCoverage(rootTest, coverage) { } function setup(root) { - if (wasRootSetup.has(root)) { + if (root.startTime !== null) { return root; } @@ -166,8 +164,6 @@ function setup(root) { coverage: null, }; root.startTime = hrtime(); - - wasRootSetup.add(root); return root; } |