@@ -42,7 +42,7 @@ describe("firebaseConfigValidate", () => {
42
42
43
43
const firstError = validator . errors ! [ 0 ] ;
44
44
expect ( firstError . keyword ) . to . eq ( "additionalProperties" ) ;
45
- expect ( firstError . dataPath ) . to . eq ( "" ) ;
45
+ expect ( firstError . instancePath ) . to . eq ( "" ) ;
46
46
expect ( firstError . params ) . to . deep . equal ( { additionalProperty : "bananas" } ) ;
47
47
} ) ;
48
48
@@ -63,18 +63,18 @@ describe("firebaseConfigValidate", () => {
63
63
64
64
// Missing required param
65
65
expect ( firstError . keyword ) . to . eq ( "required" ) ;
66
- expect ( firstError . dataPath ) . to . eq ( ". storage" ) ;
66
+ expect ( firstError . instancePath ) . to . eq ( "/ storage" ) ;
67
67
expect ( firstError . params ) . to . deep . equal ( { missingProperty : "rules" } ) ;
68
68
69
69
// Because it doesn't match the object type, we also get an "is not an array"
70
70
// error since JSON Schema can't tell which type it is closest to.
71
71
expect ( secondError . keyword ) . to . eq ( "type" ) ;
72
- expect ( secondError . dataPath ) . to . eq ( ". storage" ) ;
72
+ expect ( secondError . instancePath ) . to . eq ( "/ storage" ) ;
73
73
expect ( secondError . params ) . to . deep . equal ( { type : "array" } ) ;
74
74
75
75
// Finally we get an error saying that 'storage' is not any of the known types
76
76
expect ( thirdError . keyword ) . to . eq ( "anyOf" ) ;
77
- expect ( thirdError . dataPath ) . to . eq ( ". storage" ) ;
77
+ expect ( thirdError . instancePath ) . to . eq ( "/ storage" ) ;
78
78
expect ( thirdError . params ) . to . deep . equal ( { } ) ;
79
79
} ) ;
80
80
@@ -97,18 +97,18 @@ describe("firebaseConfigValidate", () => {
97
97
98
98
// Wrong type
99
99
expect ( firstError . keyword ) . to . eq ( "type" ) ;
100
- expect ( firstError . dataPath ) . to . eq ( ". storage. rules" ) ;
100
+ expect ( firstError . instancePath ) . to . eq ( "/ storage/ rules" ) ;
101
101
expect ( firstError . params ) . to . deep . equal ( { type : "string" } ) ;
102
102
103
103
// Because it doesn't match the object type, we also get an "is not an array"
104
104
// error since JSON Schema can't tell which type it is closest to.
105
105
expect ( secondError . keyword ) . to . eq ( "type" ) ;
106
- expect ( secondError . dataPath ) . to . eq ( ". storage" ) ;
106
+ expect ( secondError . instancePath ) . to . eq ( "/ storage" ) ;
107
107
expect ( secondError . params ) . to . deep . equal ( { type : "array" } ) ;
108
108
109
109
// Finally we get an error saying that 'storage' is not any of the known types
110
110
expect ( thirdError . keyword ) . to . eq ( "anyOf" ) ;
111
- expect ( thirdError . dataPath ) . to . eq ( ". storage" ) ;
111
+ expect ( thirdError . instancePath ) . to . eq ( "/ storage" ) ;
112
112
expect ( thirdError . params ) . to . deep . equal ( { } ) ;
113
113
} ) ;
114
114
} ) ;
0 commit comments