4.0.0 / 2018-03-22
This is a major update to the underlying dependencies and also introduces some breaking changes.
- The biggest breaking change is that this library will _no longer throw based on the status code! This means a request that returns a
404
, or500
or any other status code cannot be asserted on in thecatch
block, instead must be asserted on in thethen
block. In other words this behaves more akin tofetch
. - Another large breaking change is that the
chai.request(server)
object will automatically close the server connection after the first request. This means if you have code like this:
const request = chai.request(app)
request.get('/bar')
request.get('/bar')
you'll need to change it to:
const request = chai.request(app).keepOpen()
request.get('/bar')
request.get('/bar')
This is described further in the README
Community Contributions
Code Features & Fixes
- #123 Support responses that have
statusCode
when asserting .status (by @atom-morgan) - #128 Support asserting on cross-domain cookies (by @leggsimon)
- #136 Improve Karma support (by @bartw)
- #149 Drop node 4 support (by @vieiralucas)
- #133 Support cookies within
agent
(by @yashsriv) - #154 Support 307, 308 redirects in
.redirect()
assertion (by @tonymet)
Documentation fixes
- #102 Fix docs regarding Promises (by @keithamus)
- #127 Fix docs formatting for chaijs.com (by @Limess)
- #137 Improve docs around form data (by @ZackWard)
- #138 Add MIT license to package.json (by @noderat)
- #142 Fix semicolons in readme (by @vieiralucas)
- #160 Add examples for
.not.redirect
in readme (by @mcky) - #166 Fix docs for form tests (by @barraponto)
- #167 Add readme docs to make it easier to find out how to login during tests (by @barraponto)
- #173 Clarify using chai expect in Readme (by @cornelius-k)
- #190 Add readme note about agent not closing (by @gswalden)
- #199 Fix license typo in package.json (by @zewa666)