aboutsummaryrefslogtreecommitdiff
path: root/integration/snapshots/styledcomponents-output.hmr.debug.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-11-01 20:05:38 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-11-01 20:05:38 -0700
commit92b174b3156f317ae942f0be4ca89f05df99a4c6 (patch)
tree42f1db372a0ffa3c2fcebb04baad090c728e767e /integration/snapshots/styledcomponents-output.hmr.debug.js
parent0ba9784be2fd56700652e85c563f931c6a2bb112 (diff)
downloadbun-92b174b3156f317ae942f0be4ca89f05df99a4c6.tar.gz
bun-92b174b3156f317ae942f0be4ca89f05df99a4c6.tar.zst
bun-92b174b3156f317ae942f0be4ca89f05df99a4c6.zip
Add Bun.js integration tests, but don't run them yet.
Diffstat (limited to 'integration/snapshots/styledcomponents-output.hmr.debug.js')
-rw-r--r--integration/snapshots/styledcomponents-output.hmr.debug.js31
1 files changed, 17 insertions, 14 deletions
diff --git a/integration/snapshots/styledcomponents-output.hmr.debug.js b/integration/snapshots/styledcomponents-output.hmr.debug.js
index c10d1c492..dc9e2de7d 100644
--- a/integration/snapshots/styledcomponents-output.hmr.debug.js
+++ b/integration/snapshots/styledcomponents-output.hmr.debug.js
@@ -49,20 +49,23 @@ var hmr = new HMR(1290604342, "styledcomponents-output.js"), exports = hmr.expor
}
`;
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);
}
hmr.exportAll({
test: () => test