File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -424,6 +424,26 @@ test('processes a real world example when yaml_as_json is true and the single fi
424
424
)
425
425
} )
426
426
427
+ test ( 'processes a simple example and the single file contains no errors and uses the draft-04 ajv schema' , async ( ) => {
428
+ process . env . INPUT_BASE_DIR = '__tests__/fixtures/json/valid'
429
+ process . env . INPUT_JSON_SCHEMA_VERSION = 'draft-04'
430
+
431
+ expect ( await jsonValidator ( excludeMock ) ) . toStrictEqual ( {
432
+ failed : 0 ,
433
+ passed : 1 ,
434
+ skipped : 0 ,
435
+ success : true ,
436
+ violations : [ ]
437
+ } )
438
+
439
+ expect ( debugMock ) . toHaveBeenCalledWith (
440
+ 'using ajv-formats with json-validator'
441
+ )
442
+ expect ( debugMock ) . toHaveBeenCalledWith (
443
+ 'json - using baseDir: __tests__/fixtures/json/valid'
444
+ )
445
+ } )
446
+
427
447
test ( 'successfully validates json files with a schema when files is defined' , async ( ) => {
428
448
const files = [
429
449
'__tests__/fixtures/json/valid/json1.json' ,
You can’t perform that action at this time.
0 commit comments