Skip to content

feat!: Require Node.js v24+ and replace WebdriverIO with Vitest - #168

Merged
nzakas merged 2 commits into
mainfrom
chore/modernize-node24-browser-tests
Sep 9, 2026
Merged

nzakas merged 2 commits into
mainfrom
chore/modernize-node24-browser-tests

Conversation

@nzakas

@nzakas nzakas commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Modernizes the repo's test tooling: tests now run on Node.js 24+ / Deno 2 only, and the @humanfs/web browser tests move from the WebdriverIO browser runner to Vitest browser mode with the Playwright provider.

Why the browser tester changed

WebdriverIO resolves chromedriver/geckodriver against whatever browser happens to be installed on the machine, so version drift made the web tests fail intermittently. Playwright ships pinned browser binaries, so the browser and its driver can't disagree.

before after
config wdio.conf.js, 308 lines vitest.config.js, 22 lines
install size ~1400 packages 369 packages
web test run flaky 184 tests (chromium + firefox), ~5s, 5/5 clean runs locally

node:assert isn't resolvable in a browser bundle, so the web tests now pass a small adapter over Chai's assert β€” the same pattern packages/deno already uses to adapt Deno's assertions.

Node 24 / Deno 2

  • CI matrix: Node 20.x β†’ 24.x, Deno 1.x β†’ 2.x, denoland/setup-deno@v1 β†’ v2.
  • Added a Playwright browser-install step (--with-deps on Linux only; npx doesn't accept --workspace, so it uses npm exec).
  • engines.node β†’ >=24.0.0 across all 8 packages, @types/node β†’ ^24.0.0.

Two latent bugs this surfaced

Both were pre-existing and would have broken CI regardless:

  1. packages/box imported dotenv, which was never declared in any package.json β€” it only resolved because @wdio/cli hoisted it into the root node_modules. Removing wdio broke the box tests. Replaced with the Node 24 built-in process.loadEnvFile() rather than adding the dependency back. Nothing in box actually reads process.env, so it's a no-op hook kept for exercising the live Box API.
  2. Deno 2 is stricter about permissions β€” @humanwhocodes/retry reads process.env.DEBUG, which now throws NotCapable. Added the narrow --allow-env=DEBUG to the deno test script.

Lint

Cleared all 92 pre-existing lint errors (npm run lint now exits 0). The ESLint config declares node/browser/deno/mocha globals per directory instead of scattering /* global */ comments through the sources, which removes most of them. Also removed two dead private methods in memory-hfs-volume.js (#getObject, #getObjectFromPath β€” never called anywhere, and #private so not public API) and several entirely-unused msw handler parameters.

Renovate

config:base is deprecated β†’ config:recommended. devDependency updates stay disabled as before, with one exception: the browser test stack (playwright, vitest, @vitest/**) pins its own browser binaries, so leaving it unattended means testing against increasingly stale browsers. Validated with renovate-config-validator.

Review note

packages/box/tests/box-client.test.js has a ~2000-line diff that is almost entirely whitespace β€” the file was 4-space indented and had never been through Prettier, and the repo's own pre-commit hook (yorkie β†’ lint-staged β†’ prettier --write) reformatted it on commit. The real change there is 5 removed unused handler parameters.

Verification

  • npm run lint β€” exits 0
  • npm test β€” exits 0; box 132, core 185, deno 123 steps, memory 158, node 198, web 184 (chromium + firefox)
  • Web tests run 5Γ— consecutively with no flakes

Note for release

This is marked feat! with a BREAKING CHANGE: footer so release-please bumps every package (all are 0.x with bump-minor-pre-major, so they'll take a minor bump) for the engines.node change.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01XXP2Ca3uGrqTf3o95SfSNn

nzakas and others added 2 commits September 9, 2026 16:27
Tests now run on Node.js v24 and Deno v2 only, and the browser tests for
@humanfs/web use Vitest browser mode with the Playwright provider instead
of the WebdriverIO browser runner.

WebdriverIO resolves chromedriver/geckodriver against whatever browser
happens to be installed, so version drift made the web tests fail
intermittently. Playwright ships pinned browser binaries, so the browser
and its driver can't disagree. The 308-line wdio.conf.js is replaced by a
22-line vitest.config.js, and the install drops from ~1400 to 369
packages.

node:assert isn't resolvable in a browser bundle, so the web tests now
pass a small adapter over Chai's assert, the same way packages/deno
adapts Deno's assertions.

Other changes:

- CI matrix moves to Node 24.x / Deno 2.x, denoland/setup-deno@v2, and
  installs Playwright browsers (--with-deps on Linux only).
- packages/box imported dotenv, which was never declared in any
  package.json and only resolved because @wdio/cli hoisted it. Replaced
  with the built-in process.loadEnvFile().
- Deno 2 is stricter about permissions and @humanwhocodes/retry reads
  process.env.DEBUG, so the deno test script gains --allow-env=DEBUG.
- ESLint config declares node/browser/deno/mocha globals per directory
  instead of scattering /* global */ comments through the sources, which
  clears all 92 pre-existing lint errors. Two dead private methods in
  memory-hfs-volume.js and several unused msw handler parameters are
  removed along the way.
- Renovate: config:base is deprecated, so switch to config:recommended.
  devDependency updates stay disabled, except for the browser test stack,
  which pins its own browser binaries and goes stale if left unattended.

BREAKING CHANGE: All packages now require Node.js v24.0.0 or later.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XXP2Ca3uGrqTf3o95SfSNn
Running `deno test` from the repo root generates a deno.lock there. Only
packages/deno/deno.lock is meant to be tracked, so ignore the root one.

The pattern is anchored with a leading slash because an unanchored
`deno.lock` would also match packages/deno/deno.lock.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XXP2Ca3uGrqTf3o95SfSNn
@nzakas
nzakas merged commit 9d41384 into main Sep 9, 2026
3 checks passed
@nzakas
nzakas deleted the chore/modernize-node24-browser-tests branch September 9, 2026 22:29
@github-actions github-actions Bot mentioned this pull request Sep 9, 2026
@nzakas nzakas mentioned this pull request Sep 10, 2026
5 tasks done
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.

1 participant