Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(web): fix the workflow script test that times out on busy CI runners #21699

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/21699/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 1 changed file with 10 additions and 0 deletions.

x
0 of 1 viewed, 1 left
10 additions and 0 deletionsapps/web/src/components/chat/WorkflowOpeningBlock.browser.test.tsxModified
View file
@@ -22,6 +22,16 @@
serverEnvironment: { ...actual.serverEnvironment, configValueAtom: (() => noConfig) as never },
};
});
+// Loading the real Shiki WASM and grammar can take seconds on a busy runner; the block only
+// needs to hand its script to the markdown code block that highlights it.
+vi.mock(import("../../lib/syntaxHighlighting"), async (original) => ({
+ ...(await original()),
+ getSyntaxHighlighterPromise: async () =>
+ ({
+ codeToHtml: (code: string) =>
+ Object.assign(document.createElement("pre"), { textContent: code }).outerHTML,
+ }) as never,
+}));
​
const SHORT_SCRIPT =
"export const meta = { name: 'repo-check' }\nagent('Run SCRIPTONLY with Bash')";