chaijs / chai-http

HTTP Response assertions for the Chai Assertion Library.
http://chaijs.com/plugins/chai-http
634 stars 113 forks source link

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

Closed boly38 closed 5 months ago

boly38 commented 5 months ago

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 : https://github.com/chaijs/chai-http/issues/313 =>related discussion - working answer https://github.com/chaijs/chai-http/discussions/315#discussioncomment-8800549

working sample

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

const agent = await chai.request(app)

TODO: