feat!: v8 droping node 20 + vitest 5 + tsc 7 latest http-proxy & more - #17
Merged
Merged
Conversation
BREAKING CHANGE: minimum supported Node.js version is now 22. - Remove Node 20 from the CI matrix and bump each package's engines.node to >=22.0.0 (was >=20.0.0 / >=18.0.0 for safaridriver). - Update @zip.js/zip.js, http-proxy-agent, https-proxy-agent, which, @types/node, and typescript to their latest versions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Vitest 5 now throws instead of warning when vi.mock/vi.doMock calls aren't at module top level. Fixes two geckodriver test files that relied on the old warn-only behavior: - start-unit.test.ts: hoist the three vi.mock() calls (install.js, utils.js, node:child_process) out of the test body to the module top level, matching their actual (already-hoisted) execution order. - unit.test.ts: switch the per-test '../src/utils.js' override in "download with proxy support" from vi.mock to vi.doMock, since it's a runtime override for a dynamic import (after vi.resetModules()), not a static hoisted mock, and was never meant to replace the file-level vi.mock of the same module. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Now that every package requires Node >=22.0.0, target/lib ES2020 was stricter than necessary and downleveled syntax Node already supports natively. Node 22 covers ES2023. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Addresses PR review feedback: vi.doMock registrations aren't torn down automatically the way hoisted vi.mock calls are. Without vi.doUnmock, a later test that calls vi.resetModules() and dynamically imports utils.js/install.js would silently inherit this test's hasAccess: false stub instead of the file's real top-level mock. Also restores HTTPS_PROXY so it doesn't leak into later tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vi.mockhoisting rules.Changes
engines.nodeto>=22.0.0in all three driver packages (previously>=20.0.0, and>=18.0.0forsafaridriver).@zip.js/zip.js,http-proxy-agent,https-proxy-agent,which,@types/node, andtypescript(6 → 7).vitestand@vitest/coverage-v84.1.11 → 5.0.1.packages/node-geckodriver/tests/start-unit.test.ts: hoisted threevi.mock()calls to module scope — Vitest 5 now throws (previously warned) when they're called inside a test body.packages/node-geckodriver/tests/unit.test.ts: switched a per-test../src/utils.jsoverride tovi.doMockinstead ofvi.mock, since it's a runtime override for a dynamicimport()and was never meant to replace the file's real top-level mock of the same module.tsconfig.base.jsonwas still onES2020from before the Node 22 floor; Node 22 natively supports ES2023, so this drops unnecessary downleveling in the build output.