-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build with flag external=* (#1043)
- Loading branch information
Showing
2 changed files
with
49 additions
and
10 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 |
---|---|---|
|
@@ -21,6 +21,49 @@ Deno.test("`?external` query", async () => { | |
const res = await fetch("http://localhost:8080/*[email protected]/denonext/hooks.mjs"); | ||
assertStringIncludes(await res.text(), 'from"preact"'); | ||
} | ||
{ | ||
// ?external=react | ||
const res = await fetch("http://localhost:8080/[email protected]/X-ZXJlYWN0/es2022/client.mjs"); | ||
const code = await res.text(); | ||
assertStringIncludes(code, 'from"react"'); | ||
assertStringIncludes(code, 'from"/react-dom@'); | ||
assertStringIncludes(code, 'from"/scheduler@'); | ||
} | ||
{ | ||
// ?external=react,react-dom | ||
const res = await fetch("http://localhost:8080/[email protected]/X-ZXJlYWN0LHJlYWN0LWRvbQ/es2022/client.mjs"); | ||
const code = await res.text(); | ||
assertStringIncludes(code, 'from"react"'); | ||
assertStringIncludes(code, 'from"react-dom"'); | ||
assertStringIncludes(code, 'from"/scheduler@'); | ||
} | ||
{ | ||
// ?external=react,react-dom,scheduler | ||
const res = await fetch("http://localhost:8080/[email protected]/X-ZXJlYWN0LHJlYWN0LWRvbSxzY2hlZHVsZXI/es2022/client.mjs"); | ||
const code = await res.text(); | ||
assertStringIncludes(code, 'from"react"'); | ||
assertStringIncludes(code, 'from"react-dom"'); | ||
assertStringIncludes(code, 'from"scheduler"'); | ||
} | ||
{ | ||
const res = await fetch("http://localhost:8080/*[email protected]/es2022/client.mjs"); | ||
const code = await res.text(); | ||
assertStringIncludes(code, 'from"react"'); | ||
assertStringIncludes(code, 'from"react-dom"'); | ||
assertStringIncludes(code, 'from"scheduler"'); | ||
} | ||
{ | ||
const res = await fetch("http://localhost:8080/[email protected]/client?external=react,react-dom,scheduler"); | ||
assertStringIncludes(await res.text(), '"/[email protected]/X-ZXJlYWN0LHJlYWN0LWRvbSxzY2hlZHVsZXI/denonext/client.mjs"'); | ||
} | ||
{ | ||
const res = await fetch("http://localhost:8080/[email protected]/client?external=react,scheduler,react-dom"); | ||
assertStringIncludes(await res.text(), '"/[email protected]/X-ZXJlYWN0LHJlYWN0LWRvbSxzY2hlZHVsZXI/denonext/client.mjs"'); | ||
} | ||
{ | ||
const res = await fetch("http://localhost:8080/[email protected]/client?external=scheduler,react,react-dom"); | ||
assertStringIncludes(await res.text(), '"/[email protected]/X-ZXJlYWN0LHJlYWN0LWRvbSxzY2hlZHVsZXI/denonext/client.mjs"'); | ||
} | ||
}); | ||
|
||
Deno.test("drop invalid `?external`", async () => { | ||
|