Skip to content

Commit 62f521c

Browse files
authored
Fix #326 - readme: add how to import chai 5 and use chaiHttp 4 (#327)
1 parent e30a5b8 commit 62f521c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ const chaiHttp = require('chai-http');
2626
chai.use(chaiHttp);
2727
```
2828

29+
To use Chai HTTP in an ECMAScript module (ESM)
30+
31+
```js
32+
import chaiHttp from "chai-http";
33+
import * as chaiModule from 'chai';
34+
const chai = chaiModule.use(chaiHttp);
35+
```
36+
2937
To use Chai HTTP on a web page, just include the [`dist/chai-http.js`](dist/chai-http.js) file:
3038

3139
```html

0 commit comments

Comments
 (0)