From 831fb7ebb79d9ee16beebccfa12666df011c62df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 17 Jan 2016 15:22:31 -0500 Subject: [PATCH] Add doc about integration with chai-as-promised Close #32 --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 4e9c79c..0150a46 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,27 @@ plug in to Chai and be ready for use: ``` +### Using `chai-immutable` with `chai-as-promised` + +This plugin works fine in conjunction with +[`chai-as-promised`](https://github.com/domenic/chai-as-promised/) but note that +`chai-immutable` must be loaded **before** `chai-as-promised`. For example: + +```js +var chai = require('chai'); +var chaiImmutable = require('chai-immutable'); +var expect = chai.expect; +var chaiAsPromised = require('chai-as-promised'); + +chai.use(chaiImmutable); +chai.use(chaiAsPromised); + +var List = require('immutable').List; + +/* ... */ +return expect(List.of(1, 2, 3)).to.eventually.have.size(3); +``` + ## BDD API Reference ### .empty