Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI for node.js is broken due to chai 4.4.0 release #5153

Closed
link2xt opened this issue Jan 5, 2024 · 3 comments · Fixed by #5154
Closed

CI for node.js is broken due to chai 4.4.0 release #5153

link2xt opened this issue Jan 5, 2024 · 3 comments · Fixed by #5154

Comments

@link2xt
Copy link
Collaborator

link2xt commented Jan 5, 2024

npm run test fails with the following error:

> deltachat-node@1.132.1 test:mocha
> mocha -r esm node/test/test.js --growl --reporter=spec --bail --exit


/home/user/src/deltachat/deltachat-core-rust/node_modules/chai/lib/chai/assertion.js:69
    flag(this, 'eql', config.deepEqual ?? util.eql);
                                        ^

SyntaxError: Invalid or unexpected token
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)

I did not have this error, but then removed node_modules with the node_modules/.package-lock.json inside and now getting this error too. So it is related to some dependency update.

I then replaced chai dependency with exact version, did npm i and then npm run test passed:

diff --git a/package.json b/package.json
index b580a0ff..3d66513d 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
   "devDependencies": {
     "@types/debug": "^4.1.7",
     "@types/node": "^20.8.10",
-    "chai": "^4.2.0",
+    "chai": "4.2.0",
     "chai-as-promised": "^7.1.1",
     "esm": "^3.2.25",
     "mocha": "^8.2.1",

We can do this, but would be nice to fix the issue and use the latest version.

@link2xt
Copy link
Collaborator Author

link2xt commented Jan 5, 2024

I have tested, chai 4.4.0 published less than 9 hours ago fails. chai 4.3.10 works.

@link2xt
Copy link
Collaborator Author

link2xt commented Jan 5, 2024

So this is broken because of this PR: chaijs/chai#1553
This is the only change between chai 4.4.0 and chai 4.3.10.
Cannot update to chai 5.0 because of chaijs/chai-as-promised#281

@link2xt link2xt changed the title CI for node.js is broken CI for node.js is broken due to chai 4.4.0 release Jan 5, 2024
@link2xt
Copy link
Collaborator Author

link2xt commented Jan 5, 2024

There is a PR trying to update JS version, mocha etc., but it is not ready for merging: #4989

I made a PR to downgrade chai: #5154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant