-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,8 @@ Deno.test("external all", () => { | |
Deno.test("external all 2", async () => { | ||
const res = await fetch("http://localhost:8080/*[email protected]/jsx-runtime"); | ||
const code = await res.text(); | ||
assertStringIncludes(code, "[email protected]/X-ZS8q/"); | ||
assertStringIncludes(code, "[email protected]/X-ZS8q/denonext/"); | ||
const res2 = await fetch("http://localhost:8080/*[email protected]"); | ||
const code2 = await res2.text(); | ||
assertStringIncludes(code2, "[email protected]/denonext/preact.mjs"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { assert } from "https://deno.land/[email protected]/testing/asserts.ts"; | ||
import { assert, assertStringIncludes } from "https://deno.land/[email protected]/testing/asserts.ts"; | ||
|
||
import { h } from "preact"; | ||
import render from "preact-render-to-string"; | ||
|
@@ -26,3 +26,13 @@ Deno.test("external", () => { | |
const html = render(<App />); | ||
assert(html == "<main><p>just now</p></main>"); | ||
}); | ||
|
||
Deno.test("external 2", async () => { | ||
const res = await fetch("http://localhost:8080/[email protected]/hooks?external=preact"); | ||
const code = await res.text(); | ||
assertStringIncludes(code, "[email protected]/X-ZS9wcmVhY3Q/"); | ||
|
||
const res2 = await fetch("http://localhost:8080/[email protected]?external=preact&target=es2022"); | ||
const code2 = await res2.text(); | ||
assertStringIncludes(code2, "[email protected]/es2022/preact.mjs"); | ||
}); |