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

node: upgrade mocha from 8 to 10 #4948

Open
link2xt opened this issue Nov 6, 2023 · 0 comments · May be fixed by #4971
Open

node: upgrade mocha from 8 to 10 #4948

link2xt opened this issue Nov 6, 2023 · 0 comments · May be fixed by #4971

Comments

@link2xt
Copy link
Collaborator

link2xt commented Nov 6, 2023

Even upgrading to Mocha 9 with npm install mocha@9 does not just work.
Changelog says that at version 9.0 "Mocha is going ESM-first!".

npm run test fails with an error:

$ npm run test

> [email protected] test
> npm run test:lint && npm run test:mocha


> [email protected] test:lint
> npm run lint


> [email protected] lint
> prettier --check "node/lib/**/*.{ts,tsx}"

Checking formatting...
All matched files use Prettier code style!

> [email protected] test:mocha
> mocha -r esm node/test/test.js --growl --reporter=spec --bail --exit

(node:1986375) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)

/home/user/src/deltachat/deltachat-core-rust/node/test/test.js:2
import DeltaChat from '../dist'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at new Script (node:vm:94:7)
    at wrapSafe (node:internal/modules/cjs/loader:1157:20)
    at Module._compile (node:internal/modules/cjs/loader:1220:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
@link2xt link2xt linked a pull request Nov 10, 2023 that will close this issue
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