fix: wrong type in init files (#2492)
This commit is contained in:
+2
-2
@@ -433,9 +433,9 @@ export default define.page(function Home() {
|
|||||||
})`;
|
})`;
|
||||||
await writeFile("routes/index.tsx", ROUTES_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 (
|
return (
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|||||||
@@ -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 () => {
|
Deno.test("init - can start dev server", async () => {
|
||||||
await withTmpDir(async (dir) => {
|
await withTmpDir(async (dir) => {
|
||||||
const mock = mockUserInput({
|
const mock = mockUserInput({
|
||||||
|
|||||||
Reference in New Issue
Block a user