-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathfiles.test.ts
More file actions
38 lines (33 loc) · 1.42 KB
/
files.test.ts
File metadata and controls
38 lines (33 loc) · 1.42 KB
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
import path from "node:path";
import { describe, expect, it } from "vitest";
import { runMutationTest } from "../src/tests/testSetup.js";
describe("files", () => {
it("addition above", async () => {
const caseDir = path.join(import.meta.dirname, "cases/files/above");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
}, 7000);
it("addition below", async () => {
const caseDir = path.join(import.meta.dirname, "cases/files/below");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
}, 7000);
it("both", async () => {
const caseDir = path.join(import.meta.dirname, "cases/files/both");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
}, 7000);
it("empty addition", async () => {
const caseDir = path.join(import.meta.dirname, "cases/files/empty");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
}, 10_000);
});