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

refactor: update mocha tests with --unhandled-rejections=strict #1300

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danielpeintner
Copy link
Member

fixes #1299

@@ -887,7 +887,7 @@ class WoTServerTest {
expect(content.body).not.to.be.undefined;

const body = await content.toBuffer();
body.should.be.eq('"test"');
body.toString().should.be.eq('"newValue"');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is the correct assumption ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes correct and this was not failing without that option? this is quite bad from mocha side...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, it was not failing before.

Having said that, since the code is correct, just the test is not correct it is not as bad ...

).to.eventually.be.rejectedWith(Error); */

// TODO need to be fixed, call above works fine, reports true
// should we really fail if uri Variable is not supported/known? I don't think so...
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual question. Shall we really fail?

@danielpeintner
Copy link
Member Author

Note: I fixed some easy issues and skipped tests that fail now in

  • core
  • http
  • mqtt

I added information/questions in the commit/changes.

Please have a look.

@danielpeintner danielpeintner marked this pull request as draft July 8, 2024 16:20
@@ -28,7 +28,10 @@ const info = createInfoLogger("binding-mqtt", "mqtt-client-subscribe-test.integr
// should must be called to augment all variables
should();

describe("MQTT client implementation - integration", () => {
describe.skip("MQTT client implementation - integration", () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@egekorkan can you check the MQTT tests which I skipped?

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.

[test] Convert unhandledRejection to uncaughtException
2 participants