-
-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathtest.toPointer.js
More file actions
17 lines (16 loc) · 734 Bytes
/
test.toPointer.js
File metadata and controls
17 lines (16 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
describe('JSONPath - toPointer', function () {
it('toPointer', () => {
const expected = '/store/bicycle/color';
const result = jsonpath.toPointer(['$', 'store', 'bicycle', 'color']);
assert.deepEqual(result, expected);
});
it('toPointer (stripped)', () => {
const expected = '/store/bicycle/color';
let result = jsonpath.toPointer(['$', 'store', 'bicycle', 'color', '^']);
assert.deepEqual(result, expected);
result = jsonpath.toPointer(['$', 'store', 'bicycle', 'color', '@string()']);
assert.deepEqual(result, expected);
result = jsonpath.toPointer(['$', 'store', 'bicycle', 'color', '~']);
assert.deepEqual(result, expected);
});
});