Testing - flight505/ContextCraft GitHub Wiki
Testing Guide
This document provides an overview of the testing approaches and commands available in this project.
Unit Tests
npm test
- Runs Jest unit tests (currently 105 tests in 2 test suites)npm run test:watch
- Runs Jest in watch mode for continuous testingnpm run test:coverage
- Runs Jest with coverage reporting
Build Tests
npm run test-build:mac
- Tests macOS buildnpm run test-build:win
- Tests Windows buildnpm run test-build:linux
- Tests Linux buildnpm run test-build:cross
- Tests cross-platform builds
Native Module Tests
npm run rebuild-native-modules
- Rebuilds all native modules with C++20 support
Development Environment
npm run dev:c++20
- Runs development environment with C++20 supportnpm run dev:c++20 -- --rebuild
- Rebuilds native modules before starting dev environment
Comprehensive Testing
npm run test-all
- Runs unit tests, rebuilds native modules, and tests Mac and Windows buildsnpm run test-comprehensive
- Runs a complete test suite including:- Unit tests
- Native module rebuilding
- Build tests
- Cross-platform verification
- Development environment verification
The test-comprehensive
script is the most thorough option as it:
- Runs all unit tests
- Rebuilds native modules with C++20 support
- Tests platform-specific builds
- Verifies cross-platform compatibility
- Checks development environment setup
- Even tests C++20 compatibility by compiling a small test program
This gives you a complete testing workflow to ensure your app works correctly across platforms with proper C++20 support for native modules.