Skip to content

Commit

Permalink
chore: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Mar 20, 2024
1 parent 8e1903a commit 159e273
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div>
Host app
</div>
<div>
mounted: false
</div>
<div
data-src="embed"
id="GENERATED-0"
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
Host app
</div>
<div>
mounted: false
</div>
<div
data-src="embed"
id="GENERATED-0"
>
<div />
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div>
Host app
</div>
<div>
mounted: false
</div>
<div
data-src="embed"
id="GENERATED-0"
>
<div>
<div
hacks=""
/>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div>
Host app
</div>
<div>
mounted: false
</div>
<div
data-src="embed"
id="GENERATED-0"
>
<div>
<div
hacks=""
/>
</div>
</div>
<script>
$ssr_then_csr_with_flush_index_C=(window.$ssr_then_csr_with_flush_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["o4cI23nl"]})
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div>
Host app
</div>
<div>
mounted: false
</div>
<div>
<div>
<div
hacks=""
/>
</div>
</div>
<script>
$ssr_then_csr_with_flush_index_C=(window.$ssr_then_csr_with_flush_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["o4cI23nl"]})
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div>
Host app
</div>
<div>
mounted: true
</div>
<div>
<div>
<div
hacks=""
/>
</div>
</div>
<script>
$ssr_then_csr_with_flush_index_C=(window.$ssr_then_csr_with_flush_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["o4cI23nl"]})
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class {
onCreate() {
this.state = { mounted: false };
}
onMount() {
this.state.mounted = true;
}
}

<div>mounted: ${state.mounted}</div>
<micro-frame src="embed"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<esbuild-assets/>
<div>
$ out.write("<div ");
<await(new Promise((res) => setTimeout(res)))>
<@then>hacks</@then>
</>

$ out.write("></div>");
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Example</title>
<esbuild-assets/>
</head>
<body>
<div>Host app</div>
<app/>
</body>
</html>
5 changes: 5 additions & 0 deletions src/components/micro-frame/__tests__/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ describe(
fixture(path.join(__dirname, "fixtures/ssr-then-csr"))
);

describe(
"ssr then csr with flush",
fixture(path.join(__dirname, "fixtures/ssr-then-csr-with-flush"))
);

describe(
"csr stream text",
fixture(path.join(__dirname, "fixtures/csr-stream-text"))
Expand Down

0 comments on commit 159e273

Please sign in to comment.