Testing & Quality Assurance Guidelines
DevDiff enforces automated unit, integration, and stress testing across all monorepo packages to maintain 100% test reliability and zero runtime regressions.
Running Automated Tests
bash
# Run all unit and integration tests across the entire monorepo
pnpm test
# Run tests for a specific workspace package
pnpm --filter @eldrex/core test
pnpm --filter @eldrex/plugin-sdk test
pnpm --filter @eldrex/gateway test
pnpm --filter @eldrex/openclaw test
# Run full cross-platform release gate verification
pnpm gate # macOS / Linux
pnpm gate:ps # Windows PowerShellTesting Standards & Best Practices
- Unit Tests (
*.test.ts):- Every new engine method, CLI command, or utility in
@eldrex/coremust include Vitest unit tests inpackages/core/tests/. - All tests must pass with zero unhandled promise rejections or memory leaks.
- Every new engine method, CLI command, or utility in
- Plugin Testing with DevTools:
- When building or testing plugins, use
DevDiffDevTools.mockDiff()andDevDiffDevTools.createTestHarness()from@eldrex/plugin-sdkto simulate diff transformations and error handling in memory without touching git.
- When building or testing plugins, use
- Mocking External Providers:
- Cloud AI providers (Gemini, Groq, OpenAI, Anthropic, DeepSeek) must always be mocked during standard unit tests. Real API calls are never permitted in CI runs.
- Redaction Engine Verification:
- Security tests must verify that sensitive credentials (API keys, RSA tokens, passwords) are masked in diff payloads before assertion checks pass.