@@ -13,53 +13,59 @@ test('validation succeeds when valid data is given', checkValidationSuccess, {
1313test ( 'validation fails when a non-object is given' , checkValidationFailure , {
1414 schema : additionalFileDescriptionSchema ,
1515 data : true ,
16- expectedMessages : [ 'Expected object; but got boolean' ]
16+ expectedMessages : [ 'expected object, but got boolean' ]
1717} ) ;
1818
1919test ( 'validation fails when the an empty object is given' , checkValidationFailure , {
2020 schema : additionalFileDescriptionSchema ,
2121 data : { } ,
22- expectedMessages : [ 'At sourceFilePath: missing key or index ' , 'At targetFilePath: missing key or index ' ]
22+ expectedMessages : [ 'at sourceFilePath: missing property ' , 'at targetFilePath: missing property ' ]
2323} ) ;
2424
2525test ( 'validation fails when sourceFilePath is missing' , checkValidationFailure , {
2626 schema : additionalFileDescriptionSchema ,
2727 data : { targetFilePath : 'foo' } ,
28- expectedMessages : [ 'At sourceFilePath: missing key or index ' ]
28+ expectedMessages : [ 'at sourceFilePath: missing property ' ]
2929} ) ;
3030
3131test ( 'validation fails when sourceFilePath is not a string' , checkValidationFailure , {
3232 schema : additionalFileDescriptionSchema ,
3333 data : { sourceFilePath : [ ] , targetFilePath : 'foo' } ,
34- expectedMessages : [ 'At sourceFilePath: expected string; but got array' ]
34+ expectedMessages : [
35+ 'at sourceFilePath: expected string, but got array' ,
36+ 'at sourceFilePath: array must contain at least 1 element'
37+ ]
3538} ) ;
3639
3740test ( 'validation fails when sourceFilePath is an empty string' , checkValidationFailure , {
3841 schema : additionalFileDescriptionSchema ,
3942 data : { sourceFilePath : '' , targetFilePath : 'foo' } ,
40- expectedMessages : [ 'At sourceFilePath: expected a non empty string; but got string ' ]
43+ expectedMessages : [ 'at sourceFilePath: string must contain at least 1 character ' ]
4144} ) ;
4245
4346test ( 'validation fails when targetFilePath is missing' , checkValidationFailure , {
4447 schema : additionalFileDescriptionSchema ,
4548 data : { sourceFilePath : 'foo' } ,
46- expectedMessages : [ 'At targetFilePath: missing key or index ' ]
49+ expectedMessages : [ 'at targetFilePath: missing property ' ]
4750} ) ;
4851
4952test ( 'validation fails when targetFilePath is not a string' , checkValidationFailure , {
5053 schema : additionalFileDescriptionSchema ,
5154 data : { targetFilePath : [ ] , sourceFilePath : 'foo' } ,
52- expectedMessages : [ 'At targetFilePath: expected string; but got array' ]
55+ expectedMessages : [
56+ 'at targetFilePath: expected string, but got array' ,
57+ 'at targetFilePath: array must contain at least 1 element'
58+ ]
5359} ) ;
5460
5561test ( 'validation fails when targetFilePath is an empty string' , checkValidationFailure , {
5662 schema : additionalFileDescriptionSchema ,
5763 data : { targetFilePath : '' , sourceFilePath : 'foo' } ,
58- expectedMessages : [ 'At targetFilePath: expected a non empty string; but got string ' ]
64+ expectedMessages : [ 'at targetFilePath: string must contain at least 1 character ' ]
5965} ) ;
6066
6167test ( 'validation fails when an additional unknown property is given' , checkValidationFailure , {
6268 schema : additionalFileDescriptionSchema ,
6369 data : { targetFilePath : 'bar' , sourceFilePath : 'foo' , something : 'else' } ,
64- expectedMessages : [ 'At something: unexpected extra key or index ' ]
70+ expectedMessages : [ 'unexpected additional property: "something" ' ]
6571} ) ;
0 commit comments