From cb2a8b2832c24fb8fe208b723d1f6bdb9eff0100 Mon Sep 17 00:00:00 2001 From: Brice Vandeputte Date: Mon, 20 May 2024 18:18:51 +0200 Subject: [PATCH] Fix #326 - readme: add how to import chai 5 and use chaiHttp 4 --- 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