From 92b174b3156f317ae942f0be4ca89f05df99a4c6 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 1 Nov 2021 20:05:38 -0700 Subject: Add Bun.js integration tests, but don't run them yet. --- .../snapshots/styledcomponents-output.debug.js | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'integration/snapshots/styledcomponents-output.debug.js') diff --git a/integration/snapshots/styledcomponents-output.debug.js b/integration/snapshots/styledcomponents-output.debug.js index 0f81a0ba7..b99d434da 100644 --- a/integration/snapshots/styledcomponents-output.debug.js +++ b/integration/snapshots/styledcomponents-output.debug.js @@ -40,18 +40,21 @@ const ErrorScreenRoot = styled.div` `; export function test() { - const reactEl = document.createElement("div"); - document.body.appendChild(reactEl); - ReactDOM.render(jsx(ErrorScreenRoot, { - id: "error-el", - children: "The react child should have this text" - }, undefined, false, undefined, this), reactEl); - const style = document.querySelector("style[data-styled]"); - console.assert(style, "style tag should exist"); - console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); - console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); - ReactDOM.unmountComponentAtNode(reactEl); - reactEl.remove(); - style.remove(); - testDone(import.meta.url); + if (typeof window !== "undefined") { + const reactEl = document.createElement("div"); + document.body.appendChild(reactEl); + ReactDOM.render(jsx(ErrorScreenRoot, { + id: "error-el", + children: "The react child should have this text" + }, undefined, false, undefined, this), reactEl); + const style = document.querySelector("style[data-styled]"); + console.assert(style, "style tag should exist"); + console.assert(style.textContent.split("").every((a) => a.codePointAt(0) < 128), "style tag should not contain invalid unicode codepoints"); + console.assert(document.querySelector("#error-el").textContent === "The react child should have this text"); + ReactDOM.unmountComponentAtNode(reactEl); + reactEl.remove(); + style.remove(); + return testDone(import.meta.url); + } + return testDone(import.meta.url); } -- cgit v1.2.3