chore: update * pin prettier version & format code
This commit is contained in:
parent
5d05f87768
commit
53d4062e52
18 changed files with 93 additions and 78 deletions
|
|
@ -7,7 +7,11 @@ import { promises as fs } from "fs";
|
|||
import * as path from "path";
|
||||
|
||||
import {
|
||||
npmCmd, runCommand, WEBSNACKS_BIN_PATH, WEBSNACKS_REPO_ROOT, withTempDir
|
||||
npmCmd,
|
||||
runCommand,
|
||||
WEBSNACKS_BIN_PATH,
|
||||
WEBSNACKS_REPO_ROOT,
|
||||
withTempDir,
|
||||
} from "../helpers/e2e";
|
||||
import { testSuite } from "../lib";
|
||||
|
||||
|
|
@ -35,7 +39,7 @@ testSuite("build command", ({ test }) => {
|
|||
}),
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
await fs.writeFile(
|
||||
path.join(tempDirPath, "websnacks.ts"),
|
||||
|
|
@ -48,7 +52,7 @@ testSuite("build command", ({ test }) => {
|
|||
`,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
const pagesPath = path.join(tempDirPath, "pages");
|
||||
await fs.mkdir(pagesPath);
|
||||
|
|
@ -60,7 +64,7 @@ testSuite("build command", ({ test }) => {
|
|||
`,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
await fs.writeFile(
|
||||
path.join(tempDirPath, "package.json"),
|
||||
|
|
@ -69,7 +73,7 @@ testSuite("build command", ({ test }) => {
|
|||
websnacks: `file:${WEBSNACKS_REPO_ROOT}`,
|
||||
},
|
||||
}),
|
||||
{ encoding: "utf8" }
|
||||
{ encoding: "utf8" },
|
||||
);
|
||||
await runCommand(npmCmd, ["install", "--silent"], {
|
||||
cwd: tempDirPath,
|
||||
|
|
@ -79,7 +83,7 @@ testSuite("build command", ({ test }) => {
|
|||
[WEBSNACKS_BIN_PATH, "-r", "ts-node/register", "build"],
|
||||
{
|
||||
cwd: tempDirPath,
|
||||
}
|
||||
},
|
||||
);
|
||||
await cmd.complete;
|
||||
});
|
||||
|
|
@ -108,7 +112,7 @@ testSuite("build command", ({ test }) => {
|
|||
}),
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
const pagesPath = path.join(tempDirPath, "pages");
|
||||
await fs.mkdir(pagesPath);
|
||||
|
|
@ -120,7 +124,7 @@ testSuite("build command", ({ test }) => {
|
|||
`,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
await fs.writeFile(
|
||||
path.join(tempDirPath, "package.json"),
|
||||
|
|
@ -129,7 +133,7 @@ testSuite("build command", ({ test }) => {
|
|||
websnacks: `file:${WEBSNACKS_REPO_ROOT}`,
|
||||
},
|
||||
}),
|
||||
{ encoding: "utf8" }
|
||||
{ encoding: "utf8" },
|
||||
);
|
||||
await runCommand(npmCmd, ["install", "--silent"], {
|
||||
cwd: tempDirPath,
|
||||
|
|
@ -139,7 +143,7 @@ testSuite("build command", ({ test }) => {
|
|||
[WEBSNACKS_BIN_PATH, "-r", "ts-node/register", "build"],
|
||||
{
|
||||
cwd: tempDirPath,
|
||||
}
|
||||
},
|
||||
);
|
||||
await cmd.complete;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,7 +7,12 @@ import { promises as fs } from "fs";
|
|||
import * as path from "path";
|
||||
|
||||
import {
|
||||
npmCmd, runCommand, wait, WEBSNACKS_BIN_PATH, WEBSNACKS_REPO_ROOT, withTempDir
|
||||
npmCmd,
|
||||
runCommand,
|
||||
wait,
|
||||
WEBSNACKS_BIN_PATH,
|
||||
WEBSNACKS_REPO_ROOT,
|
||||
withTempDir,
|
||||
} from "../helpers/e2e";
|
||||
import { testSuite } from "../lib";
|
||||
|
||||
|
|
@ -35,7 +40,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
}),
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
await fs.writeFile(
|
||||
path.join(tempDirPath, "websnacks.ts"),
|
||||
|
|
@ -48,7 +53,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
`,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
const pagesPath = path.join(tempDirPath, "pages");
|
||||
await fs.mkdir(pagesPath);
|
||||
|
|
@ -60,7 +65,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
`,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
await fs.writeFile(
|
||||
path.join(tempDirPath, "package.json"),
|
||||
|
|
@ -69,7 +74,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
websnacks: `file:${WEBSNACKS_REPO_ROOT}`,
|
||||
},
|
||||
}),
|
||||
{ encoding: "utf8" }
|
||||
{ encoding: "utf8" },
|
||||
);
|
||||
await runCommand(npmCmd, ["install", "--silent"], {
|
||||
cwd: tempDirPath,
|
||||
|
|
@ -79,7 +84,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
[WEBSNACKS_BIN_PATH, "-r", "ts-node/register", "dev"],
|
||||
{
|
||||
cwd: tempDirPath,
|
||||
}
|
||||
},
|
||||
);
|
||||
// FIXME: This test is a bit brittle due to relying on timeouts.
|
||||
await wait(10_000);
|
||||
|
|
@ -112,7 +117,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
}),
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
const pagesPath = path.join(tempDirPath, "pages");
|
||||
await fs.mkdir(pagesPath);
|
||||
|
|
@ -124,7 +129,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
`,
|
||||
{
|
||||
encoding: "utf8",
|
||||
}
|
||||
},
|
||||
);
|
||||
await fs.writeFile(
|
||||
path.join(tempDirPath, "package.json"),
|
||||
|
|
@ -133,7 +138,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
websnacks: `file:${WEBSNACKS_REPO_ROOT}`,
|
||||
},
|
||||
}),
|
||||
{ encoding: "utf8" }
|
||||
{ encoding: "utf8" },
|
||||
);
|
||||
await runCommand(npmCmd, ["install", "--silent"], {
|
||||
cwd: tempDirPath,
|
||||
|
|
@ -143,7 +148,7 @@ testSuite("dev command", ({ test, expect }) => {
|
|||
[WEBSNACKS_BIN_PATH, "-r", "ts-node/register", "dev"],
|
||||
{
|
||||
cwd: tempDirPath,
|
||||
}
|
||||
},
|
||||
);
|
||||
// FIXME: This test is a bit brittle due to relying on timeouts.
|
||||
await wait(10_000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue