Skip to content

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

@link2xt

Description

@link2xt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions