fix: Auto-fix CI failure#13
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Invariant