diff options
Diffstat (limited to 'integration/snippets')
-rw-r--r-- | integration/snippets/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js | 8 | ||||
-rw-r--r-- | integration/snippets/styledcomponents-output.js | 48 | ||||
-rw-r--r-- | integration/snippets/zero.js | 1 |
3 files changed, 31 insertions, 26 deletions
diff --git a/integration/snippets/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js b/integration/snippets/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js index 370b1abec..1ba6c059d 100644 --- a/integration/snippets/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js +++ b/integration/snippets/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js @@ -4,10 +4,10 @@ import * as _loginReally from "./_login"; import * as _loginReally2 from "./_login"; import * as _authReally from "./_auth"; -module.exports.iAmCommonJs = true; -exports.YouAreCommonJS = true; -require("./_login"); -require("./_login"); +// module.exports.iAmCommonJs = true; +// exports.YouAreCommonJS = true; +// require("./_login"); +// require("./_login"); export { _login as login }; export function test() { diff --git a/integration/snippets/styledcomponents-output.js b/integration/snippets/styledcomponents-output.js index 16ac1ed6b..a79b5e24d 100644 --- a/integration/snippets/styledcomponents-output.js +++ b/integration/snippets/styledcomponents-output.js @@ -32,28 +32,32 @@ const ErrorScreenRoot = styled.div` `; export function test() { - const reactEl = document.createElement("div"); - document.body.appendChild(reactEl); - ReactDOM.render( - <ErrorScreenRoot id="error-el"> - The react child should have this text - </ErrorScreenRoot>, - reactEl - ); + if (typeof window !== "undefined") { + const reactEl = document.createElement("div"); + document.body.appendChild(reactEl); + ReactDOM.render( + <ErrorScreenRoot id="error-el"> + The react child should have this text + </ErrorScreenRoot>, + 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" - ); + 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); + ReactDOM.unmountComponentAtNode(reactEl); + reactEl.remove(); + style.remove(); + return testDone(import.meta.url); + } + + return testDone(import.meta.url); } diff --git a/integration/snippets/zero.js b/integration/snippets/zero.js new file mode 100644 index 000000000..38f521ff1 --- /dev/null +++ b/integration/snippets/zero.js @@ -0,0 +1 @@ +export const zero = "\0"; |