| 23 | }); |
| 24 | |
| 25 | function verifyObjectStructure(obj) { |
| 26 | expect(typeof obj).withContext("result from import should be an object").toEqual("object"); |
| 27 | expect(typeof obj).withContext("result from import should not be a function").not.toEqual("function"); |
| 28 | expect(obj.applyOperation).withContext("applyOperation should be a method within the object").toBeDefined(); |
| 29 | expect(obj.applyPatch).withContext("applyPatch should be a method within the object").toBeDefined(); |
| 30 | expect(obj.applyReducer).withContext("applyReducer should be a method within the object").toBeDefined(); |
| 31 | expect(obj.getValueByPointer).withContext("getValueByPointer should be a method within the object").toBeDefined(); |
| 32 | expect(obj.validate).withContext("validate should be a method within the object").toBeDefined(); |
| 33 | expect(obj.validator).withContext("validator should be a method within the object").toBeDefined(); |
| 34 | expect(obj._areEquals).withContext("_areEquals should be a method within the object").toBeDefined(); |
| 35 | expect(obj.JsonPatchError).withContext("JsonPatchError should be a method within the object").toBeDefined(); |
| 36 | expect(obj.deepClone).withContext("deepClone should be a method within the object").toBeDefined(); |
| 37 | expect(obj.escapePathComponent).withContext("escapePathComponent should be a method within the object").toBeDefined(); |
| 38 | expect(obj.unescapePathComponent).withContext("unescapePathComponent should be a method within the object").toBeDefined(); |
| 39 | expect(obj.unobserve).withContext("unobserve should be a method within the object").toBeDefined(); |
| 40 | expect(obj.observe).withContext("observe should be a method within the object").toBeDefined(); |
| 41 | expect(obj.generate).withContext("generate should be a method within the object").toBeDefined(); |
| 42 | expect(obj.compare).withContext("compare should be a method within the object").toBeDefined(); |
| 43 | } |