phase-7_alpha: legacy code cleanup
This commit is contained in:
committed by
saikiranvella
parent
357b0c0f6e
commit
93aac355cc
@@ -3,9 +3,14 @@ import assert from 'node:assert/strict';
|
||||
import { PortfolioAdvisor } from '../server/services/PortfolioAdvisor';
|
||||
import { SIGNAL } from '../server/config/constants';
|
||||
import type { PortfolioHolding } from '../server/types';
|
||||
import type { YahooFinanceClient } from '../server/clients/YahooFinanceClient';
|
||||
|
||||
// _cryptoPrices is the only method that uses the client; all other private
|
||||
// methods under test are pure calculations that never touch it.
|
||||
const stubClient = {} as unknown as YahooFinanceClient;
|
||||
|
||||
// Cast to any to access private methods — tests exercise internal behaviour directly.
|
||||
const advisor = new PortfolioAdvisor() as any;
|
||||
const advisor = new PortfolioAdvisor(stubClient) as any;
|
||||
|
||||
// Minimal holding shape used by _position and _advice (only costBasis/shares matter).
|
||||
const holding = (costBasis: number, shares: number): PortfolioHolding => ({
|
||||
|
||||
Reference in New Issue
Block a user