Skip to content

Migrate from Jest to Node test runner and restructure build#1

Merged
rjrodger merged 3 commits intomainfrom
claude/modernize-project-structure-Ts056
Mar 12, 2026
Merged

Migrate from Jest to Node test runner and restructure build#1
rjrodger merged 3 commits intomainfrom
claude/modernize-project-structure-Ts056

Conversation

@rjrodger
Copy link
Contributor

Summary

This PR migrates the project from Jest to Node's native test runner and restructures the build system to use TypeScript project references with separate src/ and test/ directories.

Key Changes

  • Test Framework Migration: Replaced Jest with Node's native node:test module and @hapi/code for assertions

    • Updated test imports to use node:test and @hapi/code instead of Jest
    • Changed assertion syntax from .toEqual() to .to.equal()
    • Removed Jest configuration and dependencies
  • Build Structure Reorganization:

    • Moved source code to src/ directory with dedicated tsconfig.json
    • Created separate test/tsconfig.json for test compilation
    • Implemented TypeScript project references for proper build ordering
    • Output now goes to dist/ (source) and dist-test/ (tests)
  • Package Configuration Updates:

    • Updated main entry point from path.js to dist/path.js
    • Updated types entry point from path.d.ts to dist/path.d.ts
    • Updated files field to include src/ and dist/ directories
    • Removed Jest and related dev dependencies
    • Added @hapi/code and @types/node dev dependencies
  • Build Scripts:

    • Changed build script to use tsc --build src test
    • Updated test script to run Node test runner with source maps enabled
    • Updated watch script to build both src and test directories
    • Removed prettier from publish workflow
  • CI/CD Updates:

    • Simplified GitHub Actions workflow to test only Node 22.x
    • Updated action versions (checkout@v4, setup-node@v4)
    • Removed Coveralls integration
  • Cleanup:

    • Removed compiled JavaScript files from root (path.js, path.min.js, path.d.ts, etc.)
    • Removed Jest configuration file
    • Updated .gitignore to exclude dist/, dist-test/, and *.tsbuildinfo

Implementation Details

The migration maintains full test coverage while modernizing the toolchain. TypeScript project references ensure proper compilation order and incremental builds. The test import path was updated to reference the compiled output (../dist/path) rather than the source.

https://claude.ai/code/session_012dToG4AUYryeoDwpaR7dV2

claude added 3 commits March 12, 2026 17:09
- Move source from root to src/ with dedicated tsconfig.json
- Build output to dist/ and dist-test/ directories
- Replace Jest with Node native test runner + @hapi/code
- Remove unnecessary devDeps: browserify, esbuild, es-jest, jest, prettier
- Add @hapi/code, @types/node; update TypeScript to ^5.8.2
- Update TS target from ES2019 to ES2021
- Update CI: Node 22.x, actions/checkout@v4, actions/setup-node@v4, remove Coveralls
- Update package.json main/types to dist/, add files field
- Clean compiled artifacts from root and test/

https://claude.ai/code/session_012dToG4AUYryeoDwpaR7dV2
- CI matrix: Node 22.x -> 24.x
- typescript: ^5.8.2 -> ^5.9.3
- @types/node: ^22.13.10 -> ^25.5.0

https://claude.ai/code/session_012dToG4AUYryeoDwpaR7dV2
- go/path.go: Path plugin tracking property paths during parsing
- go/path_test.go: Tests for path tracking, meta base, objects, arrays
- CI: Add build-go job with Go 1.24 on all platforms

https://claude.ai/code/session_012dToG4AUYryeoDwpaR7dV2
@rjrodger rjrodger merged commit 13198ee into main Mar 12, 2026
8 checks passed
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