From 62f521cb521069bafad54469790be58ac9b529b9 Mon Sep 17 00:00:00 2001 From: Vandeputte Brice Date: Tue, 21 May 2024 11:46:01 +0200 Subject: [PATCH] Fix #326 - readme: add how to import chai 5 and use chaiHttp 4 (#327) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index ec8c175..00e242c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,14 @@ const chaiHttp = require('chai-http'); chai.use(chaiHttp); ``` +To use Chai HTTP in an ECMAScript module (ESM) + +```js +import chaiHttp from "chai-http"; +import * as chaiModule from 'chai'; +const chai = chaiModule.use(chaiHttp); +``` + To use Chai HTTP on a web page, just include the [`dist/chai-http.js`](dist/chai-http.js) file: ```html