-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathinclude.test.ts
33 lines (29 loc) · 1.12 KB
/
include.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
import path from "node:path";
import { describe, expect, it } from "vitest";
import { runMutationTest } from "../src/tests/testSetup.js";
describe("include", () => {
it("asterisk", async () => {
const caseDir = path.join(import.meta.dirname, "cases/include/asterisk");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
});
it("directory", async () => {
const caseDir = path.join(import.meta.dirname, "cases/include/directory");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
});
it("sub-directory", async () => {
const caseDir = path.join(
import.meta.dirname,
"cases/include/sub-directory",
);
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
});
});