import test from 'node:test'; import assert from 'node:assert/strict'; import { readFileSync } from 'node:fs'; const source = readFileSync(new URL('../src/apps/trade-executor.mjs', import.meta.url), 'utf8'); test('trade executor dispatches each execute command once', () => { const calls = source.match(/await handleCommand\(event\);/g) || []; assert.equal(calls.length, 1); }); test('own request preflight suppresses maker quote responses to avoid self-matching', () => { assert.match(source, /withMakerSuppressed/); assert.match(source, /own_request_preflight_in_progress/); assert.match(source, /avoid self-matching/); });