-
Notifications
You must be signed in to change notification settings - Fork 213
/
requireSpec.js
24 lines (23 loc) · 2.1 KB
/
requireSpec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const jsonpatch = require('../../..');
describe('CommonJS', function () {
describe('require', function () {
it('should have the expected structure', function () {
expect(typeof jsonpatch).withContext("result from require() should be an object").toEqual("object");
expect(typeof jsonpatch).withContext("result from require() should not be a function").not.toEqual("function");
expect(jsonpatch.applyOperation).withContext("applyOperation should be a method within the object").toBeDefined();
expect(jsonpatch.applyPatch).withContext("applyPatch should be a method within the object").toBeDefined();
expect(jsonpatch.applyReducer).withContext("applyReducer should be a method within the object").toBeDefined();
expect(jsonpatch.getValueByPointer).withContext("getValueByPointer should be a method within the object").toBeDefined();
expect(jsonpatch.validate).withContext("validate should be a method within the object").toBeDefined();
expect(jsonpatch.validator).withContext("validator should be a method within the object").toBeDefined();
expect(jsonpatch.JsonPatchError).withContext("JsonPatchError should be a method within the object").toBeDefined();
expect(jsonpatch.deepClone).withContext("deepClone should be a method within the object").toBeDefined();
expect(jsonpatch.escapePathComponent).withContext("escapePathComponent should be a method within the object").toBeDefined();
expect(jsonpatch.unescapePathComponent).withContext("unescapePathComponent should be a method within the object").toBeDefined();
expect(jsonpatch.unobserve).withContext("unobserve should be a method within the object").toBeDefined();
expect(jsonpatch.observe).withContext("observe should be a method within the object").toBeDefined();
expect(jsonpatch.generate).withContext("generate should be a method within the object").toBeDefined();
expect(jsonpatch.compare).withContext("compare should be a method within the object").toBeDefined();
});
});
});