-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathcreate-test-e2e.js
41 lines (33 loc) · 1.11 KB
/
create-test-e2e.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { $, execaCommand } from "execa";
import { strict as assert } from "node:assert";
const author = "Test Author";
const description = "Test description.";
const email = "[email protected]";
const repository = "create-typescript-app";
const owner = "TestOwner";
const title = "Test Title";
await $`rm -rf ${repository}`;
await $({
stdio: "inherit",
})`c8 -o ./coverage-create -r html -r lcov --src src node ./bin/index.js --base everything --mode create --author ${author} --email ${email} --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api`;
process.chdir(repository);
const failures = [];
for (const command of [
`pnpm i`,
`pnpm run build`,
`pnpm run format --list-different`,
`pnpm run lint`,
`pnpm run lint:md`,
`pnpm run lint:package-json`,
`pnpm run lint:packages`,
`pnpm run lint:spelling`,
`pnpm run lint:knip`,
`pnpm run test run`,
`pnpm run tsc`,
]) {
const result = await execaCommand(command, { stdio: "inherit" });
if (result.exitCode) {
failures.push({ command, result });
}
}
assert.deepEqual(failures, []);