-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathall.test.ts
43 lines (36 loc) · 997 Bytes
/
all.test.ts
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
42
43
import path from "path";
import { describe, expect, it } from "vitest";
import { execSync } from "child_process";
import { cleanVitestOutput } from "./cleanVitestOutput";
const rootFolder = path.resolve(__dirname, "../..");
describe("tsc", async () => {
it("Should have the correct TypeScript errors", () => {
let result: string;
try {
result = execSync(`npx tsc`, {
cwd: rootFolder,
}).toString();
} catch (error) {
result = error.output.toString();
}
expect(result).toMatchSnapshot();
});
});
describe("vitest", async () => {
it("Should have the correct Vitest errors", () => {
let result: string;
try {
result = execSync(`npx vitest run --reporter=json --single-thread`, {
cwd: rootFolder,
stdio: "pipe",
}).toString();
} catch (error) {
result = error.output.toString();
}
expect(
cleanVitestOutput(result, {
rootFolder,
}),
).toMatchSnapshot();
});
});