Skip to content

test-perf: Load Benckmark.js first in Node.js#3008

Merged
dead-claudia merged 1 commit into
MithrilJS:mainfrom
kfule:node22_test-perf
Feb 15, 2025
Merged

test-perf: Load Benckmark.js first in Node.js#3008
dead-claudia merged 1 commit into
MithrilJS:mainfrom
kfule:node22_test-perf

Conversation

@kfule
Copy link
Copy Markdown
Contributor

@kfule kfule commented Feb 14, 2025

Description

Since Node21, global.navigator has been implemented, and together with browserMock, Benchmark.js incorrectly identifies the execution environment as a browser. It causes error on npm run perf in newer nodejs.
If Benchmark.js is loaded before browserMock, the misidentification will be avoided.

Motivation and Context

I have run npm run perf in some environments and found that the newer nodejs versions have an error.
The problem seemed to be caused by benchmark.js misidentifying the execution environment as a browser.

How Has This Been Tested?

I ran npm run perf on node22 and confirmed that no errors occurred.
Of course, node 18 and 20 do not cause errors. Also, benchmark results should not be affected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

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.
@kfule kfule requested a review from a team as a code owner February 14, 2025 13:27
@dead-claudia dead-claudia merged commit 5608a71 into MithrilJS:main Feb 15, 2025
@JAForbes JAForbes mentioned this pull request Feb 15, 2025
@kfule kfule deleted the node22_test-perf branch February 15, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants