From f22c4ae483b12fd60a152f14f4815352a5da3617 Mon Sep 17 00:00:00 2001 From: raiseCatError <315733358+raiseCatError@users.noreply.github.com> Date: Wed, 11 Nov 2026 23:02:35 +0530 Subject: [PATCH] Record the Mermaid render result when the console isolation test fails Hosted macOS CI has failed this assertion twice (runs 40630147755 and 43064876487) without saying which code the renderer returned. The assertion is unchanged; on failure it now prints the result's code and reason. A successful result carries the drawn picture, so the message is only built when the render failed. --- tests/browserConsoleChrome.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/browserConsoleChrome.test.ts b/tests/browserConsoleChrome.test.ts index 930e76e8..0955d364 100644 --- a/tests/browserConsoleChrome.test.ts +++ b/tests/browserConsoleChrome.test.ts @@ -103,7 +103,8 @@ test('a reload starts a new document; NMSh\'s find world, web pages and the Merm const rendererEvents: PageEvent[] = []; rendererPage.onEvent(event => rendererEvents.push(event)); const result = await renderer.render({source: 'flowchart LR\n A --> B\n B --> %%{init: bad}%% C\n click A call alert()', config: mermaidConfig({scheme: 'dark', text: '#ffffff', accent: '#aaaaff', line: '#888888'}), scale: 1, timeoutMs: 10_000}); - assert.ok(result.ok || result.code === 'syntax'); + // A failure names its code and reason (timeout, crashed or failed), which hosted macOS CI has not recorded before. + assert.ok(result.ok || result.code === 'syntax', result.ok ? undefined : JSON.stringify(result)); assert.equal(rendererEvents.filter(event => event.type === 'console').length, 0, 'the diagram renderer reports nothing'); assert.ok(!entries(events).some(entry => /mermaid/iu.test(entry.message))); await renderer.close();