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

[botframework-streaming] Test cases with .to.not.throw are inconclusive #4456

Closed
compulim opened this issue Apr 21, 2023 · 0 comments · Fixed by #4461
Closed

[botframework-streaming] Test cases with .to.not.throw are inconclusive #4456

compulim opened this issue Apr 21, 2023 · 0 comments · Fixed by #4461
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@compulim
Copy link
Contributor

compulim commented Apr 21, 2023

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Versions

What package version of the SDK are you using.
main

What nodejs version are you using
18

What browser version are you using
Unrelated

What os are you using
Unrelated

Describe the bug

Many of the tests write like this:

image

However, when calling expect(fn).to.not.throw. This does not call fn() to evaluate the result. It simply do nothing.

It should be expect(fn).to.not.throw().

To Reproduce

In Mocha, try this test.

it.only('should not throw', () => {
    const fn = () => {
        throw new Error('actually throw');
    };

    expect(fn).to.not.throw;
});

Expected behavior

This test should fail.

However, because .to.not.throw is not called, the test is not calling fn() and it is not thrown.

After changing to .to.not.throw(), the test will fail and this is correct behavior.

Screenshots

Additional context

There are 62 tests that are inconclusive because of this issue.

@compulim compulim added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Apr 21, 2023
compulim added a commit that referenced this issue Apr 24, 2023
…ing requests on disconnection (#4461)

* Fix inconclusive tests

* Rejects pending requests on disconnection

* isConnected should always return boolean

* Fix race condition of missed responses

* Add client/server tests

* Skip test if it is not on Windows

* Fix for Node.js 12

* Fix and skip failing tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
1 participant