fix(tests): migrate puppeteer to v25 with babel-jest esm transform#289
Merged
Conversation
Puppeteer v25 ships an ESM-only entry point (export * from 'puppeteer-core'), which the CommonJS Jest functional suites could not require, throwing "SyntaxError: Unexpected token 'export'". Add a babel-jest transform (babel.config.js + @babel/preset-env) and a transformIgnorePatterns rule so Jest can load puppeteer's ESM entry, and bump puppeteer 24.43.0 -> 25.1.0. The CI Node-engine blocker is already resolved (test matrix on 22.x, commit 44b98fb); the deploy-step 20.x pin is intentionally left for @lhci/cli (#287) and does not use puppeteer. Verified locally: test:functional 17/17 and test:accessibility (99 checks) pass against a served Hugo site; no puppeteer EBADENGINE warnings on install. Removes the now-resolved investigation note. Closes #286 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI runs cspell over all markdown (not just changed files), surfacing two pre-existing issues that block PR #289: - content/talks.md: line-wrapped "trade offs" -> "trade-offs" - docs/plan/issues/197_*.md: "judgment" -> "judgement" (en-GB) Co-Authored-By: Claude Opus 4.7 (1M context) <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
puppeteer24.43.0→25.1.0, unblocking Dependabot PR fix(deps): bump puppeteer from 24.43.0 to 25.0.4 #285 and future v25+ bumps.babel-jesttransform (babel.config.js+@babel/preset-env) and atransformIgnorePatternsrule so Jest can load puppeteer v25's ESM-only entry point (export * from 'puppeteer-core'), which previously threwSyntaxError: Unexpected token 'export'.docs/failing-tests-investigation.md.Decision (Option B): migrate to v25 rather than pinning to 24.x. The Node-engine blocker is already resolved — commit
44b98fbfmoved the CI test matrix to Node 22.x. The deploy-stepnode-version: "20.x"pin is intentionally left unchanged: it exists for@lhci/cli@0.12.x(Lighthouse, tracked as #287) and does not use puppeteer.Test plan
npm run test:functional— 17/17 pass against a served Hugo site (was: 2 suites failing to load)npm run test:accessibility— 99 checks pass, 0 violations (confirms plain-noderequire()of the ESM entry works on Node 22.12+)npm installproduces noEBADENGINEwarning for puppeteernpm audit— 0 vulnerabilitiesWebsite TestsGitHub Action green on this PRCloses #286
Follow-up ideas
Suggestions surfaced during code review of #286. Not required for this PR — consider for a future change.
babel.config.jsexists (ESM-only deps under CommonJS Jest), so future contributors don't remove it.🤖 Generated with Claude Code