feat: expose config in context + simplify page props (#2102)
This commit is contained in:
+25
-23
@@ -19,29 +19,10 @@ const mainEntry = toFileUrl(join(
|
||||
"client.ts",
|
||||
)).href;
|
||||
|
||||
Deno.test("esbuild snapshot with cwd=Deno.cwd()", async () => {
|
||||
const builder = new EsbuildBuilder({
|
||||
absoluteWorkingDir: Deno.cwd(),
|
||||
buildID: "foo",
|
||||
configPath: denoJson,
|
||||
dev: false,
|
||||
entrypoints: {
|
||||
main: mainEntry,
|
||||
},
|
||||
jsx: "react-jsx",
|
||||
target: "es2020",
|
||||
});
|
||||
|
||||
const snapshot = await builder.build();
|
||||
assertEquals(snapshot.paths, ["main.js", "metafile.json"]);
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "esbuild snapshot with cwd=/",
|
||||
ignore: Deno.build.os === "windows",
|
||||
fn: async () => {
|
||||
Deno.test("esbuild", async (t) => {
|
||||
await t.step("esbuild snapshot with cwd=Deno.cwd()", async () => {
|
||||
const builder = new EsbuildBuilder({
|
||||
absoluteWorkingDir: "/",
|
||||
absoluteWorkingDir: Deno.cwd(),
|
||||
buildID: "foo",
|
||||
configPath: denoJson,
|
||||
dev: false,
|
||||
@@ -54,5 +35,26 @@ Deno.test({
|
||||
|
||||
const snapshot = await builder.build();
|
||||
assertEquals(snapshot.paths, ["main.js", "metafile.json"]);
|
||||
},
|
||||
});
|
||||
|
||||
await t.step({
|
||||
name: "esbuild snapshot with cwd=/",
|
||||
ignore: Deno.build.os === "windows",
|
||||
fn: async () => {
|
||||
const builder = new EsbuildBuilder({
|
||||
absoluteWorkingDir: "/",
|
||||
buildID: "foo",
|
||||
configPath: denoJson,
|
||||
dev: false,
|
||||
entrypoints: {
|
||||
main: mainEntry,
|
||||
},
|
||||
jsx: "react-jsx",
|
||||
target: "es2020",
|
||||
});
|
||||
|
||||
const snapshot = await builder.build();
|
||||
assertEquals(snapshot.paths, ["main.js", "metafile.json"]);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user