Skip to content

refactor: replace jest with node built-in test runner#52

Merged
zkochan merged 1 commit into
mainfrom
node-test
Mar 26, 2026
Merged

refactor: replace jest with node built-in test runner#52
zkochan merged 1 commit into
mainfrom
node-test

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Mar 26, 2026

Summary

  • Replace Jest with Node's built-in test runner (node:test)
  • Use t.assert.snapshot() with a custom serializer for readable multiline snapshots
  • Remove jest, @types/jest from devDependencies
  • Remove test/tsconfig.json (no longer needed without Jest type-checking)
  • Windows-only snapshots are committed for regression detection

Test plan

  • All 58 tests pass locally on macOS
  • Verify CI passes on Ubuntu
  • Verify CI passes on Windows (including Windows-only cross-drive and e2e tests)

- Use node:test with describe/test/before and t.assert.snapshot()
- Custom snapshot serializer for readable multiline output
- Remove jest, @types/jest from devDependencies
- Remove test/tsconfig.json (no longer needed)
- Snapshot files use .snapshot extension (Node convention)
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 migrates the project’s test suite from Jest to Node’s built-in test runner (node:test), updating snapshot handling accordingly and removing Jest-related tooling from dependencies/config.

Changes:

  • Replace Jest test APIs with node:test + node:assert/strict across unit and e2e tests.
  • Switch snapshot testing to t.assert.snapshot() and update committed snapshot files to the new format.
  • Remove Jest dependencies/config and the Jest-specific test/tsconfig.json; update package.json test script.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/tsconfig.json Removed Jest-driven JS typechecking config for tests.
test/test.js Ported unit tests to node:test, updated assertions/hooks, and switched snapshots to t.assert.snapshot().
test/test.js.snapshot Updated snapshot keys/content to Node snapshot format and new test name hierarchy.
test/setup.js Replaced Jest beforeAll setup with an exported setupFixtures() helper for node:test hooks.
test/e2e.test.js Ported Windows-only e2e test to node:test and updated snapshot assertions.
test/e2e.test.js.snapshot Updated e2e snapshots to Node snapshot format and new test name hierarchy.
package.json Removed Jest scripts/config/deps and updated test:unit to use node --test.
pnpm-lock.yaml Removed Jest and transitive dependencies from lockfile.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

Comment thread test/e2e.test.js
import fs from 'node:fs'
import path from 'node:path'
import { describe, test, snapshot } from 'node:test'
import assert from 'node:assert/strict'
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

Unused import: assert is imported but never used in this file. Removing it will keep the test file tidy and avoid unused-import lint warnings if linting is added/enabled later.

Suggested change
import assert from 'node:assert/strict'

Copilot uses AI. Check for mistakes.
@zkochan zkochan merged commit da710c4 into main Mar 26, 2026
8 of 10 checks passed
@zkochan zkochan deleted the node-test branch March 26, 2026 01:26
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