@@ -644,42 +644,42 @@ describe("Error messages", async () => {
644644 } ) ;
645645
646646 const dialects = [
647- { name : "draft-2020-12" , schema : "https://json-schema.org/draft/2020-12/schema" } ,
648- { name : "draft-2019-09" , schema : "https://json-schema.org/draft/2019-09/schema" } ,
649- { name : "draft-07" , schema : "http://json-schema.org/draft-07/schema" } ,
650- { name : "draft-06" , schema : "http://json-schema.org/draft-06/schema" } ,
651- { name : "draft-04" , schema : "http://json-schema.org/draft-04/schema" }
652- ] ;
653-
654- for ( const { name, schema } of dialects ) {
655- test ( `format: email (${ name } )` , async ( ) => {
656- registerSchema ( {
657- $schema : schema ,
658- format : "email"
659- } , schemaUri ) ;
647+ { name : "draft-2020-12" , schema : "https://json-schema.org/draft/2020-12/schema" } ,
648+ { name : "draft-2019-09" , schema : "https://json-schema.org/draft/2019-09/schema" } ,
649+ { name : "draft-07" , schema : "http://json-schema.org/draft-07/schema" } ,
650+ { name : "draft-06" , schema : "http://json-schema.org/draft-06/schema" } ,
651+ { name : "draft-04" , schema : "http://json-schema.org/draft-04/schema" }
652+ ] ;
653+
654+ for ( const { name, schema } of dialects ) {
655+ test ( `format: email (${ name } )` , async ( ) => {
656+ registerSchema ( {
657+ $schema : schema ,
658+ format : "email"
659+ } , schemaUri ) ;
660+
661+ const instance = "not-an-email" ;
662+ const output = {
663+ valid : false ,
664+ errors : [
665+ {
666+ absoluteKeywordLocation : "https://example.com/main#/format" ,
667+ instanceLocation : "#"
668+ }
669+ ]
670+ } ;
660671
661- const instance = "not-an-email" ;
662- const output = {
663- valid : false ,
664- errors : [
672+ const result = await betterJsonSchemaErrors ( output , schemaUri , instance ) ;
673+
674+ expect ( result . errors ) . to . eql ( [
665675 {
666- absoluteKeywordLocation : "https://example.com/main#/format" ,
667- instanceLocation : "#"
676+ schemaLocation : "https://example.com/main#/format" ,
677+ instanceLocation : "#" ,
678+ message : localization . getFormatErrorMessage ( "email" )
668679 }
669- ]
670- } ;
671-
672- const result = await betterJsonSchemaErrors ( output , schemaUri , instance ) ;
673-
674- expect ( result . errors ) . to . eql ( [
675- {
676- schemaLocation : "https://example.com/main#/format" ,
677- instanceLocation : "#" ,
678- message : localization . getFormatErrorMessage ( "email" )
679- }
680- ] ) ;
681- } ) ;
682- }
680+ ] ) ;
681+ } ) ;
682+ }
683683 test ( "pattern" , async ( ) => {
684684 registerSchema ( {
685685 $schema : "https://json-schema.org/draft/2020-12/schema" ,
0 commit comments