You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/any.test.js
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,12 @@ test('should throw a TypeError with the path to the key of the invalid value /1'
186
186
187
187
conststringify=build(schema)
188
188
189
-
t.throws(()=>stringify({kind: 'Baz',value: 1}),newTypeError('The value of \'#\' does not match schema definition.'))
189
+
t.throws(()=>stringify({kind: 'Baz',value: 1}),Object.assign(newTypeError('The value of \'#\' does not match schema definition.'),{
190
+
validationErrors: [
191
+
{message: 'must be equal to one of the allowed values',schemaPath: '#/properties/kind/enum',instancePath: '/kind'},
192
+
{message: 'must be equal to one of the allowed values',schemaPath: '#/properties/kind/enum',instancePath: '/kind'}
193
+
]
194
+
}))
190
195
})
191
196
192
197
test('should throw a TypeError with the path to the key of the invalid value /2',(t)=>{
@@ -227,5 +232,10 @@ test('should throw a TypeError with the path to the key of the invalid value /2'
227
232
228
233
conststringify=build(schema)
229
234
230
-
t.throws(()=>stringify({data: {kind: 'Baz',value: 1}}),newTypeError('The value of \'#/properties/data\' does not match schema definition.'))
235
+
t.throws(()=>stringify({data: {kind: 'Baz',value: 1}}),Object.assign(newTypeError('The value of \'#/properties/data\' does not match schema definition.'),{
236
+
validationErrors: [
237
+
{message: 'must be equal to one of the allowed values',schemaPath: '#/properties/kind/enum',instancePath: '/kind'},
238
+
{message: 'must be equal to one of the allowed values',schemaPath: '#/properties/kind/enum',instancePath: '/kind'}
0 commit comments