Skip to content

Conversation

danielpeintner
Copy link
Member

resolves #1373

@danielpeintner danielpeintner requested a review from relu91 as a code owner May 7, 2025 09:47
@danielpeintner
Copy link
Member Author

danielpeintner commented May 7, 2025

It seems node-mbus seems to cause issues

EDIT: opened Apollon77/node-mbus#134

@danielpeintner
Copy link
Member Author

We seem to run into a similar issue as mentioned in mochajs/mocha#5317

@danielpeintner
Copy link
Member Author

I think the issue has to do with @testdeck/mocha were we are using an old version. Anyhow, switching to the latest version 0.3.3 which is already 3 years old doesn't help either.

Once I start adding a test with "suite" I get the following message

SyntaxError: Named export 'suite' not found. The requested module '@testdeck/mocha' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@testdeck/mocha';
const { suite } = pkg;

or messages like

Exception during run: SyntaxError[ @d:\projects\WoT\thingweb\thingweb.node-wot-danielpeintner\packages\core\test\ClientTest.ts ]: Invalid or unexpected token
at compileSourceTextModule (node:internal/modules/esm/utils:351:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:107:18)
at ModuleLoader. (node:internal/modules/esm/translators:608:10)
at ModuleLoader.#translate (node:internal/modules/esm/loader:546:12)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:593:27)
at async ModuleJob.#link (node:internal/modules/esm/module_job:180:19)

Other test pass. Any proposal?

I am wondering whether we should remove @testdeck/mocha entirely
and switch to the assert test style

import { assert } from 'chai';

describe("Foo Tests", () => {
   it("should fooABC", () => {
      const result = ...;
      assert.equal(result, 5);
   });
});

@danielpeintner
Copy link
Member Author

danielpeintner commented Jul 30, 2025

The @testdeck/mocha dependency seems no longer providing updates (last update was Dec 2023).

We currently use it in some test in the following packages

  • binding-coap (3 test files)
  • binding-http (7 test files)
  • binding-websockets (1 test file)
  • cli (1 test file)
  • core (9 test files)

Shall we make the effort to update those tests, or what is the best way forward?

Any other opinions? Maybe there is an easier fix 🤷‍♂️

@danielpeintner
Copy link
Member Author

I created testdeck/testdeck#391

@danielpeintner
Copy link
Member Author

No response/feedback in testdeck/testdeck#391.

I think we ought to change all tests to remove testdeck dependencies to properly run Node.js 24.
Any (other) opinion?

@erossignon
Copy link
Contributor

PR #1418 fixes the CI/CD error that was in mocha.

# Conflicts:
#	package-lock.json
#	packages/binding-mbus/package.json
@danielpeintner
Copy link
Member Author

@relu91 I think the PR is now ready. Please take a look.

@relu91 relu91 merged commit 7c1aac0 into eclipse-thingweb:master Sep 5, 2025
14 checks passed
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 this pull request may close these issues.

Node.js 24 is coming
3 participants