Skip to content

Commit 5608a71

Browse files
kfuledead-claudia
authored andcommitted
test-perf: Load Benckmark.js first in Node.js
Since Node21, global.navigator has been implemented, and together with browserMock, Benchmark.js incorrectly identifies the execution environment as a browser. If Benchmark.js is loaded before browserMock, the misidentification will be avoided.
1 parent 8b8abde commit 5608a71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

performance/test-perf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ if (isDOM) {
4343
window.rootElem = null
4444
} else {
4545
/* eslint-disable global-require */
46+
Benchmark = require("benchmark")
4647
global.window = require("../test-utils/browserMock")()
4748
global.document = window.document
4849
// We're benchmarking renders, not our throttling.
@@ -51,7 +52,6 @@ if (isDOM) {
5152
}
5253
global.m = require("../index.js")
5354
global.rootElem = null
54-
Benchmark = require("benchmark")
5555
/* eslint-enable global-require */
5656
}
5757

0 commit comments

Comments
 (0)