import test from 'node:test'; import assert from 'node:assert/strict'; import { readFileSync } from 'node:fs'; const source = readFileSync(new URL('../src/apps/history-writer.mjs', import.meta.url), 'utf8'); test('history writer replays durable topics but joins the raw quote firehose live', () => { assert.match(source, /fromBeginning:\s*topic !== config\.kafkaTopicRawNearIntentsQuote/); assert.match(source, /Raw quote volume is a live firehose/); }); test('history writer passes tracked assets into portfolio valuation', () => { assert.match(source, /trackedAssets:\s*tradingConfig\.trackedAssets/); assert.match(source, /valuationAssets:\s*inputs\.valuationAssets \|\| \[\]/); assert.match(source, /inputs\.valuationAssets[\s\S]+asset\.priceId/); });