Skip to content

Commit 7dc82dc

Browse files
committed
chore: update chai
1 parent 9d08b9a commit 7dc82dc

File tree

4 files changed

+26
-58
lines changed

4 files changed

+26
-58
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@rollup/plugin-babel": "^6.0.4",
6666
"@rollup/plugin-terser": "^0.4.4",
6767
"c8": "^9.1.0",
68-
"chai": "^4.4.1",
68+
"chai": "^5.0.0",
6969
"core-js-bundle": "^3.35.0",
7070
"coveradge": "^0.8.2",
7171
"eslint": "^8.56.0",

pnpm-lock.yaml

Lines changed: 23 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-helpers/node-env.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
import {assert, expect} from 'chai';
22

3-
// Test when Node VM is not supported
4-
const toStr = Object.prototype.toString;
5-
// eslint-disable-next-line no-extend-native
6-
Object.prototype.toString = function () {
7-
if (this === global.process) {
8-
if (global.forceBuiltinVM) {
9-
throw new Error('oops');
10-
}
11-
// Native is not doing this here now
12-
return '[object process]';
13-
}
14-
return toStr.call(Object.prototype);
15-
};
16-
173
global.assert = assert;
184
global.expect = expect;
195

206
setTimeout(async () => {
21-
global.forceBuiltinVM = false;
227
const {JSONPath} = await import('../src/jsonpath-node.js');
238
global.jsonpathNodeVM = JSONPath;
249
global.jsonpath = JSONPath;
25-
global.forceBuiltinVM = true;
10+
2611
const {
2712
JSONPath: JSONPathBrowser
2813
} = await import('../src/jsonpath-browser.js');

test/test.callback.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,7 @@ describe('JSONPath - Callback', function () {
9191
}
9292
jsonpath({json, path: '$.store.bicycle', resultType: 'all', wrap: false, callback});
9393
assert.deepEqual(result[0], expected[0]);
94-
// Todo[chai@>=5]: Error with circular perhaps will be resolved per https://github.com/chaijs/chai/issues/1109#issuecomment-395980733
95-
// so can try directly comparing whole object (as commented out) rather
96-
// than in parts as below that
97-
// assert.deepEqual(result, expected);
98-
Object.keys(result[1]).forEach((prop) => {
99-
assert.deepEqual(result[1][prop], expected[1][prop]);
100-
});
101-
Object.keys(result[2]).forEach((prop) => {
102-
assert.deepEqual(result[2][prop], expected[2][prop]);
103-
});
94+
assert.deepEqual(result, expected);
10495
});
10596

10697
// https://github.com/s3u/JSONPath/issues/126

0 commit comments

Comments
 (0)