node-wot icon indicating copy to clipboard operation
node-wot copied to clipboard

[test] Convert unhandledRejection to uncaughtException

Open danielpeintner opened this issue 7 months ago • 0 comments

As mentioned in https://github.com/eclipse-thingweb/node-wot/pull/1298 by @relu91 (see here https://github.com/eclipse-thingweb/node-wot/pull/1298#discussion_r1666540417) mocha ignores the new nodejs mechanism of reporting async unhandled exceptions.

We need to set mocha --unhandled-rejections=strict --require ts-node/register --extension ts in all package.json files.

Doing so for binding-http shows already some issues. see https://github.com/eclipse-thingweb/node-wot/pull/1298#discussion_r1668559113

plus: we also might want to rework the test introduced in https://github.com/eclipse-thingweb/node-wot/pull/1298 by simply doing something like (await text(data.body)).should.eql("Test event");

danielpeintner avatar Jul 08 '24 13:07 danielpeintner