Skip to content

Commit

Permalink
add test checking that entrypoints are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Feb 7, 2024
1 parent 14300de commit 30fe146
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/wrangler/src/__tests__/type-generation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,24 @@ describe("generateTypes()", () => {
"
`);
});

it("should accept a toml file without an entrypoint and fallback to the standard modules declarations", async () => {
fs.writeFileSync(
"./wrangler.toml",
TOML.stringify({
vars: bindingsConfigMock.vars,
} as unknown as TOML.JsonMap),
"utf-8"
);

await runWrangler("types");
expect(std.out).toMatchInlineSnapshot(`
"interface Env {
SOMETHING: \\"asdasdfasdf\\";
ANOTHER: \\"thing\\";
OBJECT_VAR: {\\"enterprise\\":\\"1701-D\\",\\"activeDuty\\":true,\\"captian\\":\\"Picard\\"};
}
"
`);
});
});

0 comments on commit 30fe146

Please sign in to comment.