-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathcustomMutators.test.ts
More file actions
33 lines (29 loc) · 1.14 KB
/
customMutators.test.ts
File metadata and controls
33 lines (29 loc) · 1.14 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
import path from "node:path";
import { describe, expect, it } from "vitest";
import { runMutationTest } from "../src/tests/testSetup.js";
describe("Custom mutators", () => {
it("empty array", async () => {
const caseDir = path.join(
import.meta.dirname,
"cases/custom mutators/empty",
);
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
});
it("one mutator", async () => {
const caseDir = path.join(import.meta.dirname, "cases/custom mutators/one");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
});
it("two mutators", async () => {
const caseDir = path.join(import.meta.dirname, "cases/custom mutators/two");
const { actualContent, expectedFilePath, options } =
await runMutationTest(caseDir);
await expect(actualContent).toMatchFileSnapshot(expectedFilePath);
expect(options).toMatchSnapshot("options");
}, 15_000);
});