Skip to content

fix: Created a `todo#16

Open
invariant-ci[bot] wants to merge 5 commits into
mainfrom
invariant/fix-ci-jxh98w
Open

fix: Created a `todo#16
invariant-ci[bot] wants to merge 5 commits into
mainfrom
invariant/fix-ci-jxh98w

Conversation

@invariant-ci
Copy link
Copy Markdown

@invariant-ci invariant-ci Bot commented Jan 8, 2026

Created a todo.md file summarizing the current test coverage, highlighting 57% coverage across 21 of 37 source files, with critical gaps in workers and API areas needing immediate attention.

Review checklist

  • Changes look correct
  • Tests pass
  • No unintended changes

Invariant

Invariant Bot and others added 5 commits January 8, 2026 15:52
Added extensive unit test coverage for critical risk management components:

- **OrderExecutor Tests** (order-executor.test.ts):
  - Position sizing (fixed, percentage-based, dynamic, performance-based)
  - Risk checks (equity, position count, exposure limits)
  - Edge cases and boundary conditions
  - 47 test cases covering calculatePositionSize, calculateExposure, canOpenPosition

- **MultiExchangePositionManager Tests** (multi-exchange-position-manager.test.ts):
  - Position monitoring across exchanges
  - Stop loss and take profit checks
  - Trailing stop activation
  - Position conversion and aggregation
  - 48 test cases covering unified position management

- **Advanced Exit Logic Tests** (advanced-exit-logic.test.ts):
  - Partial profit taking
  - Profit lock stops
  - Peak protection
  - Break-even stops
  - Time-based exits
  - Exit condition priority
  - 36 test cases covering complex exit strategies

- **Position Sync Tests** (position-sync.test.ts):
  - Exchange position synchronization
  - External position import
  - Position tracking and cleanup
  - 23 test cases covering sync operations

Total: 154 new test cases providing comprehensive coverage of risk
management features including position sizing, exposure control, stop
loss/take profit logic, and multi-exchange coordination.

Tests validate critical risk controls that protect against excessive
losses and ensure proper position management across the trading system.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🤖 Generated by Invariant
fixed: Test failures in `live-trading-resilience
- Updated jest.config.js to transform both .ts and .js files using ts-jest
- Added allowJs option to tsconfig in jest transform configuration
- Extended transformIgnorePatterns to include @paradex and @Polymarket packages
- Added mock for multiExchangeExecutor in multi-exchange-position-manager tests
  to prevent "No exchanges configured" errors during unit tests

This resolves the CI test failures where Jest couldn't parse ES module imports
from the @paradex/sdk dependency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added todo.md file documenting current test coverage across the codebase:
- 23 test files covering 21 of 37 source files (57% coverage)
- Detailed breakdown by module (Services, Utils, Workers, API, etc.)
- Identified priority areas for additional test coverage
- Highlighted 1 skipped test and gaps in worker/strategy coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant