Skip to content

Commit 85d48a7

Browse files
committed
test(runValidation): Add tests
1 parent e4d8966 commit 85d48a7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import anyTest, {TestFn} from "ava";
2+
import * as sinon from "sinon";
3+
import esmock from "esmock";
4+
5+
// Define test context type
6+
const test = anyTest as TestFn<{
7+
sinon: sinon.SinonSandbox;
8+
runValidation: typeof import("../../../../src/tools/run_manifest_validation/runValidation.js").default;
9+
}>;
10+
11+
// Setup test context before each test
12+
test.beforeEach(async (t) => {
13+
// Create a sandbox for sinon stubs
14+
t.context.sinon = sinon.createSandbox();
15+
// Import the runValidation function
16+
t.context.runValidation = (await esmock("../../../../src/tools/run_manifest_validation/runValidation.js")).default;
17+
});
18+
19+
// Clean up after each test
20+
test.afterEach.always((t) => {
21+
t.context.sinon.restore();
22+
});
23+
24+
test.serial("runValidation returns correct result on success", async (t) => {
25+
// Import the actual function to verify it's callable
26+
const {runValidation} = t.context;
27+
28+
// const result = await runValidation("/nonexistent/path");
29+
// t.deepEqual(result, {
30+
// valid: true,
31+
// errors: [],
32+
// });
33+
});

0 commit comments

Comments
 (0)