Skip to content

Commit 90fa96a

Browse files
committed
- Testing: Improve coverage
1 parent 2b1efe6 commit 90fa96a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test.eval.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,20 @@ checkBuiltInVMAndNodeVM(function (vmType, setBuiltInState) {
6060
assert.deepEqual(result, expected);
6161
});
6262

63+
it('sandbox (with `arguments`)', () => {
64+
const expected = [json.store.book];
65+
const selector = "$..[?(@.category === arguments)]";
66+
const result = jsonpath({
67+
json,
68+
path: selector,
69+
sandbox: {
70+
arguments: 'reference'
71+
},
72+
wrap: false
73+
});
74+
assert.deepEqual(result, expected);
75+
});
76+
6377
it('sandbox with function without "function" in string', () => {
6478
const expected = [json.store.book];
6579
const result = jsonpath({

0 commit comments

Comments
 (0)