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

document the way to use chain 5 and import to get chai-http request #326

Closed
boly38 opened this issue May 20, 2024 · 0 comments · Fixed by #327
Closed

document the way to use chain 5 and import to get chai-http request #326

boly38 opened this issue May 20, 2024 · 0 comments · Fixed by #327

Comments

@boly38
Copy link
Contributor

boly38 commented May 20, 2024

As chai end user, and for a Node ESM project, I install chai (5.1.1) and chai-http (4.4.0) in latest version and I'm alsways asking myself on how to do chai import statement. So I need to rely on up-to-date online chai/chai-http doc

Chai-http related issue : #313
=>related discussion - working answer #315 (comment)

working sample

import chaiHttp from "chai-http";
import * as chaiModule from 'chai';
const chai = chaiModule.use(chaiHttp);

const agent = await chai.request(app)

TODO:

  • improve chain-http readme : ✔️
  • ESM guide : improve provided sample ? I didn't success to import request and use it directly. My side I'm using chai.request(app) as agent then agent.request..
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 a pull request may close this issue.

1 participant