Tests: Signal Engine Unit Test Coverage
Current state
The signal engine in packages/core/src/signals/engine.ts has little to no unit test coverage. This is a critical path — signal logic bugs directly affect users.
What to test
For each indicator function, write tests covering:
-
RSI calculator
- RSI > 70 → SELL vote
- RSI < 30 → BUY vote
- RSI 30–70 → HOLD vote
- Edge cases: empty data, single candle
-
MACD crossover
- MACD crosses above signal line → BUY
- MACD crosses below signal line → SELL
- No crossover → HOLD
-
Bollinger Band squeeze
- Bands narrow (squeeze) + breakout up → BUY
- Bands narrow (squeeze) + breakout down → SELL
-
EMA crossover
- 9 EMA crosses above 21 EMA → BUY
- 9 EMA crosses below 21 EMA → SELL
-
Signal aggregator
- 4 BUY votes, 1 SELL → final signal = BUY
- Verify confidence score calculation
Tech
- Test framework: Jest or Vitest (match whatever is in package.json)
- Mock OHLCV data: use fixture files in
__tests__/fixtures/
Acceptance criteria
Good first issue because
Pure unit tests — no infrastructure, no Docker, just TypeScript and test fixtures.
Tests: Signal Engine Unit Test Coverage
Current state
The signal engine in
packages/core/src/signals/engine.tshas little to no unit test coverage. This is a critical path — signal logic bugs directly affect users.What to test
For each indicator function, write tests covering:
RSI calculator
MACD crossover
Bollinger Band squeeze
EMA crossover
Signal aggregator
Tech
__tests__/fixtures/Acceptance criteria
packages/core/src/signals/engine.tsnpm testin CIGood first issue because
Pure unit tests — no infrastructure, no Docker, just TypeScript and test fixtures.