Skip to content

fix: Auto-fix CI failure#13

Merged
mmchougule merged 4 commits into
mainfrom
invariant/fix-ci-s439ca
Jan 8, 2026
Merged

fix: Auto-fix CI failure#13
mmchougule merged 4 commits into
mainfrom
invariant/fix-ci-s439ca

Conversation

@invariant-ci
Copy link
Copy Markdown

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

Auto-fix by Invariant

This PR was automatically generated to fix CI failures.

What was fixed

Claude Code analyzed the CI failure logs and made the necessary code changes.

Review checklist

  • Changes look correct
  • Tests pass
  • No unintended changes

Invariant

Invariant Bot and others added 4 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>
@mmchougule mmchougule merged commit b4f0644 into main Jan 8, 2026
3 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.

1 participant