Skip to content

Commit f744554

Browse files
thymikeeclaude
andcommitted
test: keep the failure that explains a missed materialization in the transport test
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 9a4e081 commit f744554

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎src/__tests__/cli-run-transport.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,21 @@ test('a CLI run builds one transport, shared by the remote-materialization clien
6262
vi.spyOn(process.stdout, 'write').mockReturnValue(true);
6363
vi.spyOn(process.stderr, 'write').mockReturnValue(true);
6464

65+
// The run ends through the stubbed process.exit; any other failure is kept to explain a miss below.
66+
let failure: unknown;
6567
await runCli(
6668
['open', '--state-dir', stateDir, '--json'],
6769
{ sendToDaemon: vi.fn(), transportForHost },
6870
host,
69-
).catch(() => undefined);
71+
).catch((error: unknown) => {
72+
failure = error;
73+
});
74+
const cause = failure instanceof Error && failure.message !== 'exit' ? failure.message : 'none';
7075

71-
assert.ok(commands.includes('lease_allocate'), `materialization ran: ${commands.join(',')}`);
76+
assert.ok(
77+
commands.includes('lease_allocate'),
78+
`materialization ran: ${commands.join(',')}; failure: ${cause}`,
79+
);
7280
assert.ok(commands.length > 1, 'the command client sent through the same transport');
7381
assert.equal(transportForHost.mock.calls.length, 1);
7482
fs.rmSync(root, { recursive: true, force: true });

0 commit comments

Comments
 (0)