eclipse-thingweb / eclipse-thingweb/node-wot

[test] Convert unhandledRejection to uncaughtException

Open
#1,299 0 comments 1 reaction 0 assignees View on GitHub
binding-http
Dominant language
TypeScript
Stars
192
Forks
100
Avg merge
3d 2h
Merged PRs (30d)
6

Description

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");`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.