Conversation
- 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)
There was a problem hiding this comment.
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/strictacross 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; updatepackage.jsontest 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.
| import fs from 'node:fs' | ||
| import path from 'node:path' | ||
| import { describe, test, snapshot } from 'node:test' | ||
| import assert from 'node:assert/strict' |
There was a problem hiding this comment.
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' |
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
node:test)t.assert.snapshot()with a custom serializer for readable multiline snapshotsjest,@types/jestfrom devDependenciestest/tsconfig.json(no longer needed without Jest type-checking)Test plan