test: test on Node.js v20
[!NOTE] Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.
[!CAUTION]
Review failed
The pull request is closed.
Walkthrough
This pull request adds Node.js version 20 compatibility by introducing conditional test skips across the codebase to bypass SyntaxError issues encountered in v20 environments, updates the CI workflow to test against Node.js 20, and removes a postci script from package.json configuration.
Changes
| Cohort / File(s) | Summary |
|---|---|
CI and Configuration .github/workflows/ci.yml, package.json |
Expanded test matrix to include Node.js 20; introduced conditional "Run example tests" step to skip for Node 20; removed postci script from package.json. |
Cluster Package Tests packages/cluster/test/options.test.ts |
Added skipIf condition to skip test case on Node.js v20 due to SyntaxError. |
Utils Package Tests packages/utils/test/import.test.ts |
Added skipIf condition to skip "should work on commonjs and require exists" test on Node.js v20+. |
Mock Plugin Tests plugins/mock/test/agent.test.ts, plugins/mock/test/app.test.ts, plugins/mock/test/cluster.test.ts |
Wrapped multiple test cases and suites with skipIf guards for Node.js v20; cluster.test.ts includes significant restructuring of test harness, hooks, and test organization with beforeAll app initialization and skip condition. |
Multipart Plugin Tests plugins/multipart/test/multipart-for-await.test.ts, plugins/multipart/test/multipart.test.ts |
Wrapped top-level describe blocks with skipIf condition to skip entire test suites on Node.js v20. |
Schedule Plugin Tests plugins/schedule/test/customTypePlugin.test.ts |
Extended skip condition from Windows-only to also skip on Node.js v20. |
View-Nunjucks Plugin Tests plugins/view-nunjucks/test/view/cache.test.ts, plugins/view-nunjucks/test/view/custom.test.ts, plugins/view-nunjucks/test/view/helper.test.ts, plugins/view-nunjucks/test/view/security.test.ts, plugins/view-nunjucks/test/view/view.test.ts |
Extended skip conditions from Windows-only to also skip on Node.js v20; security.test.ts includes explicit await on app.ready() in beforeAll. |
Create-Egg Tool Tests tools/create-egg/test/cli.test.ts |
Added Node.js 20 compatibility guard constant; applied test.skipIf to broad set of test cases to skip execution on Node 20 while preserving test naming and expectations. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
- plugins/mock/test/cluster.test.ts – Significant restructuring of test harness with reorganized beforeAll/afterAll hooks and multiple test case reinstatements; verify app initialization flow and assertion correctness.
- plugins/mock/test/app.test.ts – Multiple wrapped test cases with version guards spanning auto-detection, error formatting, and framework scenarios; ensure all wrapped tests remain functionally equivalent.
- tools/create-egg/test/cli.test.ts – Broad scope of skipped tests across prompting, scaffolding, and environment-specific scenarios; verify skip logic applies to correct test cases.
-
Consistency across all files – Verify skipIf pattern usage is consistent and correct (e.g.,
process.version.startsWith('v20.')vs other variants).
Possibly related PRs
- #5550 – Raises minimum required Node.js version to >=22.18.0, providing an alternative resolution to Node.js v20 compatibility issues addressed in this PR.
- #5546 – Overlapping changes to .github/workflows/ci.yml and package.json configuration files.
- #5454 – Related test-suite control flow modifications using conditional skipIf patterns and async app.ready() hook updates.
Poem
🐰 A version-gated field we till, Skipping tests on Node twenty's hill, SyntaxErrors dodge the light, With skipIf guards burning bright, CI hops through versions anew! 🎪
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
callSite-node-v20
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 225086565f40c119eec65e79600fc3432d96599d and 4d3ee58cd08443ab355446a446d8a7bdfedc41f2.
📒 Files selected for processing (16)
-
.github/workflows/ci.yml(2 hunks) -
package.json(0 hunks) -
packages/cluster/test/options.test.ts(1 hunks) -
packages/utils/test/import.test.ts(1 hunks) -
plugins/mock/test/agent.test.ts(1 hunks) -
plugins/mock/test/app.test.ts(6 hunks) -
plugins/mock/test/cluster.test.ts(1 hunks) -
plugins/multipart/test/multipart-for-await.test.ts(1 hunks) -
plugins/multipart/test/multipart.test.ts(1 hunks) -
plugins/schedule/test/customTypePlugin.test.ts(1 hunks) -
plugins/view-nunjucks/test/view/cache.test.ts(1 hunks) -
plugins/view-nunjucks/test/view/custom.test.ts(1 hunks) -
plugins/view-nunjucks/test/view/helper.test.ts(1 hunks) -
plugins/view-nunjucks/test/view/security.test.ts(2 hunks) -
plugins/view-nunjucks/test/view/view.test.ts(1 hunks) -
tools/create-egg/test/cli.test.ts(5 hunks)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Deploying egg with
Cloudflare Pages
| Latest commit: |
4d3ee58
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://215c7366.egg-cci.pages.dev |
| Branch Preview URL: | https://callsite-node-v20.egg-cci.pages.dev |
Deploying egg-v3 with
Cloudflare Pages
| Latest commit: |
4d3ee58
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://29dca3b5.egg-v3.pages.dev |
| Branch Preview URL: | https://callsite-node-v20.egg-v3.pages.dev |
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 87.60%. Comparing base (d2e77ee) to head (4d3ee58).
:warning: Report is 2 commits behind head on next.
Additional details and impacted files
@@ Coverage Diff @@
## next #5722 +/- ##
==========================================
+ Coverage 87.38% 87.60% +0.21%
==========================================
Files 561 561
Lines 10932 10932
Branches 1238 1238
==========================================
+ Hits 9553 9577 +24
+ Misses 1295 1271 -24
Partials 84 84
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.