Skip to content

Commit e8c4c99

Browse files
committed
chai: update to v5
This version only ships ES6 modules, so we need to tweak how it's imported & used. Change-Id: I2f1ea444d072dc815717f69170e1951010383f54 Reviewed-on: https://chromium-review.googlesource.com/c/apps/libapps/+/6217759 Reviewed-by: Joel Hockey <[email protected]> Tested-by: kokoro <[email protected]>
1 parent 42c323a commit e8c4c99

File tree

15 files changed

+30
-20
lines changed

15 files changed

+30
-20
lines changed

hterm/html/hterm_test.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset='utf-8'/>
55

66
<!-- npm modules -->
7-
<script src='../../node_modules/chai/chai.js'></script>
87
<script src='../../node_modules/mocha/mocha.js'></script>
98

109
<!-- initialize the test framework; this must come first -->

hterm/js/hterm_test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
/**
66
* @fileoverview Test framework setup when run inside the browser.
7+
* @suppress {moduleLoad} closure compiler can't handle node_modules/.
78
*/
89

10+
import {assert} from '../../node_modules/chai/chai.js';
11+
912
// Setup the mocha framework.
1013
mocha.setup('bdd');
1114
mocha.checkLeaks();
1215

1316
// Add a global shortcut to the assert API.
14-
globalThis['assert'] = chai.assert;
17+
globalThis['assert'] = assert;
1518

1619
// Catch any random errors before the test runner runs.
1720
let earlyError = null;

hterm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"devDependencies": {
3131
"@rollup/plugin-node-resolve": "~15",
32-
"chai": "~4",
32+
"chai": "~5",
3333
"eslint": "~8",
3434
"mocha": "~11",
3535
"mocha-headless-chrome": "~4",

libdot/bin/node

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import libdot
1616
# The hash of the node_modules that we maintain.
1717
# Allow a long line for easy automated updating.
1818
NODE_MODULES_HASH = (
19-
"f54d402945ab7d7be9cc882249ace797e392b24abbbf3ea20feeb6b71d6c4ea8"
19+
"d384bf88a099d6b1f1140c8eefee178d1b6923fda2fe8d0a9f0055a44acd171f"
2020
)
2121

2222
# In sync with Chromium's DEPS file because it's easier to use something that

libdot/html/lib_test.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset='utf-8'/>
55

66
<!-- npm modules -->
7-
<script src='../../node_modules/chai/chai.js'></script>
87
<script src='../../node_modules/mocha/mocha.js'></script>
98

109
<!-- initialize the test framework; this must come first -->

libdot/js/lib_test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
/**
66
* @fileoverview Test framework setup when run inside the browser.
7+
* @suppress {moduleLoad} closure compiler can't handle node_modules/.
78
*/
89

10+
import {assert} from '../../node_modules/chai/chai.js';
11+
912
// Setup the mocha framework.
1013
mocha.setup('bdd');
1114
mocha.checkLeaks();
1215

1316
// Add a global shortcut to the assert API.
14-
globalThis['assert'] = chai.assert;
17+
globalThis['assert'] = assert;
1518

1619
// Catch any random errors before the test runner runs.
1720
let earlyError = null;

libdot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"test": "./bin/load_tests"
2727
},
2828
"devDependencies": {
29-
"chai": "~4",
29+
"chai": "~5",
3030
"eslint": "~8",
3131
"mocha": "~11",
3232
"mocha-headless-chrome": "~4",

nassh/html/nassh_test.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset='utf-8'/>
55

66
<!-- npm modules -->
7-
<script src='../../node_modules/chai/chai.js'></script>
87
<script src='../../node_modules/mocha/mocha.js'></script>
98

109
<!-- initialize the test framework; this must come first -->

nassh/js/nassh_test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
/**
66
* @fileoverview Test framework setup when run inside the browser.
7+
* @suppress {moduleLoad} closure compiler can't handle node_modules/.
78
*/
89

10+
import {assert} from '../../node_modules/chai/chai.js';
11+
912
// Setup the mocha framework.
1013
mocha.setup('bdd');
1114
mocha.checkLeaks();
1215

1316
// Add a global shortcut to the assert API.
14-
globalThis['assert'] = chai.assert;
17+
globalThis['assert'] = assert;
1518

1619
// Catch any random errors before the test runner runs.
1720
let earlyError = null;

nassh/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"devDependencies": {
3232
"@rollup/plugin-node-resolve": "~15",
3333
"@rollup/plugin-terser": "~0",
34-
"chai": "~4",
34+
"chai": "~5",
3535
"eslint": "~8",
3636
"http-server": "~14",
3737
"license-checker": "~25",

0 commit comments

Comments
 (0)