Skip to content

Commit

Permalink
fix: wrong type in init files (#2492)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister authored Jun 4, 2024
1 parent 339ee98 commit bcfb4e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ export default define.page(function Home() {
})`;
await writeFile("routes/index.tsx", ROUTES_HOME);

const APP_WRAPPER = `import { type FreshContext } from "@fresh/core";
const APP_WRAPPER = `import { type PageProps } from "@fresh/core";
export default function App({ Component }: FreshContext) {
export default function App({ Component }: PageProps) {
return (
<html>
<head>
Expand Down
19 changes: 19 additions & 0 deletions init/src/init_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,25 @@ Deno.test("init - with vscode", async () => {
});
});

Deno.test("init - type check project", async () => {
await withTmpDir(async (dir) => {
const mock = mockUserInput({
[InitStep.ProjectName]: ".",
});
await initProject(dir, [], {}, mock.tty);
await expectProjectFile(dir, "main.ts");
await expectProjectFile(dir, "dev.ts");

const check = await new Deno.Command(Deno.execPath(), {
args: ["check", "main.ts", "dev.ts"],
cwd: dir,
stderr: "inherit",
stdout: "inherit",
}).output();
expect(check.code).toEqual(0);
});
});

Deno.test("init - can start dev server", async () => {
await withTmpDir(async (dir) => {
const mock = mockUserInput({
Expand Down

0 comments on commit bcfb4e3

Please sign in to comment.