(operation, index, tree, existingPath)
| 497 | |
| 498 | |
| 499 | const validator = function(operation, index, tree, existingPath) { |
| 500 | throw new jsonpatch.JsonPatchError( |
| 501 | 'Operation `value` property must not contain the old value', |
| 502 | 'OPERATION_VALUE_MUST_NOT_CONTAIN_OLD_VALUE', |
| 503 | index, |
| 504 | operation, |
| 505 | tree |
| 506 | ); |
| 507 | } |
| 508 | const customError = jsonpatch.validate(sequence, tree, validator); |
| 509 | expect(customError.index).toBe(0); |
| 510 | expect(customError.name).toBe('OPERATION_VALUE_MUST_NOT_CONTAIN_OLD_VALUE'); |
nothing calls this directly
no outgoing calls
no test coverage detected