File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
test/lib/tools/run_manifest_validation Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments