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

ESM node 20.17.0 issue with chai and chai-http #1642

Open
CristhianR opened this issue Sep 29, 2024 · 3 comments
Open

ESM node 20.17.0 issue with chai and chai-http #1642

CristhianR opened this issue Sep 29, 2024 · 3 comments
Labels
waiting-on-reporter Issues where we are waiting to hear back from the original reporter

Comments

@CristhianR
Copy link

CristhianR commented Sep 29, 2024

Hello I am having issues using chai and chai-http with nodejs version 20.17.0 using type: module.
Current libraries version: "chai": "^5.1.1", "chai-http": "^5.0.0" and "mocha": "^10.7.3".
Look my test files:

Screenshot from 2024-09-29 10-54-25

Now look the output:

Screenshot from 2024-09-29 10-57-01

How the second test (BAD_REQUEST) fails if it has the same configuration of the first test (OK)?

Also I imported chai-http with 'chai-http/index.js' to avoid the WARNING deprecation, but chai.request is not define.

@CristhianR
Copy link
Author

And if I import the chai-http module (like always) I got the following WARNING:

Screenshot from 2024-09-29 11-01-42

But the result is the same...

@CristhianR
Copy link
Author

And yes, if I define the BAD_REQUEST test inside of the OK test it works, but the idea is to have the error codes type in different files. May you please help me?

Note: When I import chaiHttp with 'chai-htpp', chai.request.execute() exists, with 'chai-http/index' do not exist and the WARNING appears.

@43081j
Copy link
Contributor

43081j commented Oct 6, 2024

Can you try upgrade to the latest chai-http and see if the warning goes away at least?

@koddsson koddsson added the waiting-on-reporter Issues where we are waiting to hear back from the original reporter label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-reporter Issues where we are waiting to hear back from the original reporter
Projects
None yet
Development

No branches or pull requests

3 participants