Skip to content

chore: upgrade Node.js to v22 for development and expand test coverage#2

Merged
ysfscream merged 2 commits intomainfrom
chore/upgrade-node-22-and-add-tests
Jan 20, 2026
Merged

chore: upgrade Node.js to v22 for development and expand test coverage#2
ysfscream merged 2 commits intomainfrom
chore/upgrade-node-22-and-add-tests

Conversation

@ysfscream
Copy link
Copy Markdown
Member

Summary

  • Upgrade development Node.js version from v18 to v22 in .nvmrc
  • Update CI lint workflow to use Node 22
  • Expand CI test matrix to cover Node 18, 20, 22, and 23
  • Fix type guard functions to return strict boolean values
  • Add comprehensive tests for type guards, environment detection, and Zod schemas
  • Keep package.json engines at >=18 for user compatibility

Test plan

  • Verified all tests pass on Node 18.17.1 locally
  • CI should pass on Node 18, 20, 22, and 23

- Upgrade development Node.js version from v18 to v22 in .nvmrc
- Update CI lint workflow to use Node 22
- Expand CI test matrix to cover Node 18, 20, 22, and 23
- Fix type guard functions (isRequest, isResponse, isNotification) to return
  strict boolean values instead of falsy values
- Add comprehensive tests for type guards, environment detection, McpError
  serialization, and Zod schema validation
- Keep package.json engines at >=18 for user compatibility
Copilot AI review requested due to automatic review settings January 19, 2026 08:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the development Node.js version from v18 to v22 while maintaining backward compatibility, expands CI test coverage across Node 18, 20, 22, and 23, and adds comprehensive test suites for type guards, environment detection, and Zod schemas.

Changes:

  • Update development Node.js version to v22 in .nvmrc and lint workflow
  • Expand CI test matrix to include Node 18, 20, 22, and 23
  • Wrap type guard return expressions in Boolean() for strict boolean returns
  • Add comprehensive tests for type guards (isRequest, isResponse, isNotification), environment detection (isNode, isBrowser), and McpError serialization
  • Add new test file for validating Zod schemas and ErrorCode constants

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.nvmrc Updates development Node.js version from v18 to v22
.github/workflows/lint.yml Updates lint workflow to use Node 22
.github/workflows/test.yml Expands test matrix to include Node 18, 20, 22, and 23
src/shared/utils.ts Wraps type guard return expressions in Boolean() for explicit boolean coercion
test/utils.test.ts Adds comprehensive tests for type guards, environment detection, and McpError serialization
test/types.test.ts Adds new test file covering JSON-RPC schemas, Tool/Resource schemas, and ErrorCode validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ysfscream ysfscream merged commit 72e3cae into main Jan 20, 2026
8 checks passed
@ysfscream ysfscream deleted the chore/upgrade-node-22-and-add-tests branch January 20, 2026 01:09
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