Skip to content

Write HTML. Render video. Built for agents.

test(core): the var() font fallback test no longer waits on Google Fonts (#5623)

Miguel Ángel8f0bcadcd328
diff --git a/packages/core/src/fonts/deterministicFonts.test.ts b/packages/core/src/fonts/deterministicFonts.test.ts
index 1d572d2295..5189a5b26d 100644
--- a/packages/core/src/fonts/deterministicFonts.test.ts
+++ b/packages/core/src/fonts/deterministicFonts.test.ts
@@ -213,7 +213,13 @@ describe("var() font-family fallbacks", () => {
it("injects the fallback family of an undefined custom property", async () => {
const html = styled(`body { font-family: var(--font-body, Inter, system-ui, sans-serif); }`);
- const result = await injectDeterministicFontFaces(html, { allowSystemFontCapture: false });
+ const fetchImpl = Object.assign(async () => new Response("", { status: 404 }), {
+ preconnect: fetch.preconnect,
+ });
+ const result = await injectDeterministicFontFaces(html, {
+ fetchImpl,
+ allowSystemFontCapture: false,
+ });
expect(result).toContain(`font-family: "Inter";`);
});