Release History

v5.1.2

Version v5.1.2

What’s Changed

  • Fix secret name in publish action by @koddsson in https://github.com/chaijs/chai/pull/1614
  • Publish npm packages with provenance by @koddsson in https://github.com/chaijs/chai/pull/1615
  • build(deps-dev): bump braces from 3.0.2 to 3.0.3 by @dependabot in https://github.com/chaijs/chai/pull/1625
  • chore: bump loupe and deep-eql by @43081j in https://github.com/chaijs/chai/pull/1635
  • build(deps-dev): bump @75lb/deep-merge from 1.1.1 to 1.1.2 by @dependabot in https://github.com/chaijs/chai/pull/1636
  • build(deps): bump rollup from 4.9.1 to 4.22.4 by @dependabot in https://github.com/chaijs/chai/pull/1637
  • chore: update deep dependencies by @43081j in https://github.com/chaijs/chai/pull/1641
  • chore: upgrade loupe by @43081j in https://github.com/chaijs/chai/pull/1646
  • Support big int in approximently by @koddsson in https://github.com/chaijs/chai/pull/1606

Full Changelog: https://github.com/chaijs/chai/compare/v5.1.1…v5.1.2

v4.5.0

Version v4.5.0

  • Update type detect (#1631) 1a36d35

https://github.com/chaijs/chai/compare/v4.4.1…v4.5.0

What’s Changed

  • Update type detect by @koddsson in https://github.com/chaijs/chai/pull/1631

Full Changelog: https://github.com/chaijs/chai/compare/v4.4.1…v4.5.0

v5.1.1

Version v5.1.1

What’s Changed

  • Set up ESLint for JSDoc comments by @koddsson in https://github.com/chaijs/chai/pull/1605
  • build(deps-dev): bump ip from 1.1.8 to 1.1.9 by @dependabot in https://github.com/chaijs/chai/pull/1608
  • Correct Mocha import instructions by @MattiSG in https://github.com/chaijs/chai/pull/1611
  • fix: support some virtual contexts in toThrow by @43081j in https://github.com/chaijs/chai/pull/1609

New Contributors

  • @MattiSG made their first contribution in https://github.com/chaijs/chai/pull/1611

Full Changelog: https://github.com/chaijs/chai/compare/v5.1.0…v5.1.1

v5.1.0

Version v5.1.0

What’s Changed

  • Remove useless guards and add parentheses to constuctors by @koddsson in https://github.com/chaijs/chai/pull/1593
  • Cleanup jsdoc comments by @koddsson in https://github.com/chaijs/chai/pull/1596
  • Convert comments in “legal comments” format to jsdoc or normal comments by @koddsson in https://github.com/chaijs/chai/pull/1598
  • Implement iterable assertion by @koddsson in https://github.com/chaijs/chai/pull/1592
  • Assert interface fix by @developer-bandi in https://github.com/chaijs/chai/pull/1601
  • Set support in same members by @koddsson in https://github.com/chaijs/chai/pull/1583
  • Fix publish script by @koddsson in https://github.com/chaijs/chai/pull/1602

New Contributors

  • @developer-bandi made their first contribution in https://github.com/chaijs/chai/pull/1601

Full Changelog: https://github.com/chaijs/chai/compare/v5.0.3…v5.1.0

v5.0.3

Version v5.0.3

Fix bad v5.0.2 publish.

Full Changelog: https://github.com/chaijs/chai/compare/v5.0.2…v5.0.3

v5.0.2

Version v5.0.2

What’s Changed

  • build(deps): bump nanoid and mocha by @dependabot in https://github.com/chaijs/chai/pull/1558
  • remove bump-cli by @koddsson in https://github.com/chaijs/chai/pull/1559
  • Update developer dependencies by @koddsson in https://github.com/chaijs/chai/pull/1560
  • fix: removes ?? for node compat (5.x) by @43081j in https://github.com/chaijs/chai/pull/1576
  • Update loupe to latest version by @koddsson in https://github.com/chaijs/chai/pull/1579
  • Re-enable some webkit tests by @koddsson in https://github.com/chaijs/chai/pull/1580
  • Remove a bunch of if statements in test/should.js by @koddsson in https://github.com/chaijs/chai/pull/1581
  • Remove a bunch of unused files by @koddsson in https://github.com/chaijs/chai/pull/1582
  • Fix 1564 by @koddsson in https://github.com/chaijs/chai/pull/1566

Full Changelog: https://github.com/chaijs/chai/compare/v5.0.1…v5.0.2

v4.4.1

Version v4.4.1

What’s Changed

  • fix: removes ?? for node compat by @43081j in https://github.com/chaijs/chai/pull/1574

Full Changelog: https://github.com/chaijs/chai/compare/v4.4.0…v4.4.1

v4.4.0

Version v4.4.0

What’s Changed

  • Allow deepEqual fonction to be configured globally (4.x.x branch) by @forty in https://github.com/chaijs/chai/pull/1553

Full Changelog: https://github.com/chaijs/chai/compare/v4.3.10…v4.4.0

v5.0.0-rc.0

Version v5.0.0-rc.0

The first Release Candidate of chai@v5 is here!

We’ve put out a few alpha versions and tested them out in various projects with good success. This RC includes all those changes plus any fixes that we’ve discovered since then.

Please try it out in your projects and let us know if you run into any issues so we can make fixes before version 5!

Thanks for using Chai 🙏🏻

What’s Changed

  • feat: use chaijs/loupe for inspection by @pcorpet in https://github.com/chaijs/chai/pull/1401
  • docs: fix URL in README by @Izzur in https://github.com/chaijs/chai/pull/1413
  • Remove get-func-name dependency by @koddsson in https://github.com/chaijs/chai/pull/1416
  • Convert Makefile script to npm scripts by @koddsson in https://github.com/chaijs/chai/pull/1424
  • Clean up README badges by @koddsson in https://github.com/chaijs/chai/pull/1422
  • fix: package.json - deprecation warning on exports field by @stevenjoezhang in https://github.com/chaijs/chai/pull/1400
  • fix: deep-eql bump package to support symbols by @snewcomer in https://github.com/chaijs/chai/pull/1458
  • ES module conversion PoC by @43081j in https://github.com/chaijs/chai/pull/1498
  • chore: drop commonjs support by @43081j in https://github.com/chaijs/chai/pull/1503
  • Update pathval by @koddsson in https://github.com/chaijs/chai/pull/1527
  • Update check-error by @koddsson in https://github.com/chaijs/chai/pull/1528
  • update deep-eql to latest version by @koddsson in https://github.com/chaijs/chai/pull/1542
  • Inline type-detect as a simple function by @koddsson in https://github.com/chaijs/chai/pull/1544
  • Update loupe by @koddsson in https://github.com/chaijs/chai/pull/1545
  • Typo ‘Test an object’ not ‘Test and object’ by @mavaddat in https://github.com/chaijs/chai/pull/1460
  • Update assertion-error to it’s latest major version! by @koddsson in https://github.com/chaijs/chai/pull/1543
  • Replacing Karma with Web Test Runner by @koddsson in https://github.com/chaijs/chai/pull/1546
  • remove codecov by @koddsson in https://github.com/chaijs/chai/pull/1548
  • remove chai version constant by @koddsson in https://github.com/chaijs/chai/pull/1550
  • Remove istanbul by @koddsson in https://github.com/chaijs/chai/pull/1549

New Contributors

  • @Izzur made their first contribution in https://github.com/chaijs/chai/pull/1413
  • @koddsson made their first contribution in https://github.com/chaijs/chai/pull/1416
  • @stevenjoezhang made their first contribution in https://github.com/chaijs/chai/pull/1400
  • @43081j made their first contribution in https://github.com/chaijs/chai/pull/1498

Full Changelog: https://github.com/chaijs/chai/compare/v4.3.10…v5.0.0-rc.0

v5.0.0

Version v5.0.0

BREAKING CHANGES

  • Chai now only supports EcmaScript Modules (ESM). This means your tests will need to either have import {...} from 'chai' or import('chai'). require('chai') will cause failures in nodejs. If you’re using ESM and seeing failures, it may be due to a bundler or transpiler which is incorrectly converting import statements into require calls.
  • Dropped support for Internet Explorer.
  • Dropped support for NodeJS < 18.
  • Minimum supported browsers are now Firefox 100, Safari 14.1, Chrome 100, Edge 100. Support for browsers prior to these versions is “best effort” (bug reports on older browsers will be assessed individually and may be marked as wontfix).

What’s Changed

  • feat: use chaijs/loupe for inspection by @pcorpet in https://github.com/chaijs/chai/pull/1401
  • docs: fix URL in README by @Izzur in https://github.com/chaijs/chai/pull/1413
  • Remove get-func-name dependency by @koddsson in https://github.com/chaijs/chai/pull/1416
  • Convert Makefile script to npm scripts by @koddsson in https://github.com/chaijs/chai/pull/1424
  • Clean up README badges by @koddsson in https://github.com/chaijs/chai/pull/1422
  • fix: package.json - deprecation warning on exports field by @stevenjoezhang in https://github.com/chaijs/chai/pull/1400
  • fix: deep-eql bump package to support symbols by @snewcomer in https://github.com/chaijs/chai/pull/1458
  • ES module conversion PoC by @43081j in https://github.com/chaijs/chai/pull/1498
  • chore: drop commonjs support by @43081j in https://github.com/chaijs/chai/pull/1503
  • Update pathval by @koddsson in https://github.com/chaijs/chai/pull/1527
  • Update check-error by @koddsson in https://github.com/chaijs/chai/pull/1528
  • update deep-eql to latest version by @koddsson in https://github.com/chaijs/chai/pull/1542
  • Inline type-detect as a simple function by @koddsson in https://github.com/chaijs/chai/pull/1544
  • Update loupe by @koddsson in https://github.com/chaijs/chai/pull/1545
  • Typo ‘Test an object’ not ‘Test and object’ by @mavaddat in https://github.com/chaijs/chai/pull/1460
  • Update assertion-error to it’s latest major version! by @koddsson in https://github.com/chaijs/chai/pull/1543
  • Replacing Karma with Web Test Runner by @koddsson in https://github.com/chaijs/chai/pull/1546

New Contributors

  • @Izzur made their first contribution in https://github.com/chaijs/chai/pull/1413
  • @stevenjoezhang made their first contribution in https://github.com/chaijs/chai/pull/1400
  • @43081j made their first contribution in https://github.com/chaijs/chai/pull/1498

Full Changelog: https://github.com/chaijs/chai/compare/4.3.1…v5.0.0

v5.0.0-alpha.2

Version v5.0.0-alpha.2

What’s Changed

  • update deep-eql to latest version by @koddsson in https://github.com/chaijs/chai/pull/1542
  • Inline type-detect as a simple function by @koddsson in https://github.com/chaijs/chai/pull/1544
  • Update loupe by @koddsson in https://github.com/chaijs/chai/pull/1545
  • Typo ‘Test an object’ not ‘Test and object’ by @mavaddat in https://github.com/chaijs/chai/pull/1460
  • Update assertion-error to it’s latest major version! by @koddsson in https://github.com/chaijs/chai/pull/1543
  • Replacing Karma with Web Test Runner by @koddsson in https://github.com/chaijs/chai/pull/1546

Full Changelog: https://github.com/chaijs/chai/compare/v5.0.0-alpha.1…v5.0.0-alpha.2

v4.3.10

Version v4.3.10

This release simply bumps all dependencies to their latest non-breaking versions.

What’s Changed

  • upgrade all dependencies by @keithamus in https://github.com/chaijs/chai/pull/1540

Full Changelog: https://github.com/chaijs/chai/compare/v4.3.9…v4.3.10

v4.3.9

Version v4.3.9

Upgrade dependencies.

This release upgrades dependencies to address CVE-2023-43646 where a large function name can cause “catastrophic backtracking” (aka ReDOS attack) which can cause the test suite to hang.

Full Changelog: https://github.com/chaijs/chai/compare/v4.3.8…v4.3.9

v4.3.8

Version v4.3.8

What’s Changed

  • 4.x.x: Fix link to commit logs on GitHub by @bugwelle in https://github.com/chaijs/chai/pull/1487
  • build(deps): bump socket.io-parser from 4.0.4 to 4.0.5 by @dependabot in https://github.com/chaijs/chai/pull/1488
  • Small typo in test.js by @mavaddat in https://github.com/chaijs/chai/pull/1459
  • docs: specify return type of objDisplay by @scarf005 in https://github.com/chaijs/chai/pull/1490
  • Update CONTRIBUTING.md by @matheus-rodrigues00 in https://github.com/chaijs/chai/pull/1521
  • Fix: update exports.version to current version by @peanutenthusiast in https://github.com/chaijs/chai/pull/1534

New Contributors

  • @bugwelle made their first contribution in https://github.com/chaijs/chai/pull/1487
  • @mavaddat made their first contribution in https://github.com/chaijs/chai/pull/1459
  • @scarf005 made their first contribution in https://github.com/chaijs/chai/pull/1490
  • @matheus-rodrigues00 made their first contribution in https://github.com/chaijs/chai/pull/1521
  • @peanutenthusiast made their first contribution in https://github.com/chaijs/chai/pull/1534

Full Changelog: https://github.com/chaijs/chai/compare/v4.3.7…v4.3.8

v5.0.0-alpha.1

Version v5.0.0-alpha.1

What’s Changed

  • chore: drop commonjs support by @43081j in https://github.com/chaijs/chai/pull/1503
  • Update pathval by @koddsson in https://github.com/chaijs/chai/pull/1527
  • Update check-error by @koddsson in https://github.com/chaijs/chai/pull/1528

Full Changelog: https://github.com/chaijs/chai/compare/v5.0.0-alpha.0…v5.0.0-alpha.1

v5.0.0-alpha.0

Version v5.0.0-alpha.0

This release is the first alpha release for Chai 5. The changes from v4.x:

  • This package now uses ESM modules. CommonJS environments are no longer supported. If you wish to use a CommonJS environment, please continue to use Chai 4.
  • Drop support for NodeJS versions less than 16. If you are using NodeJS v4-v15, please continue to use Chai 4.
  • Drop support for Internet Explorer 10 & 11. If you wish to test against Internet Explorer 10 or 11 please continue to use Chai 4.
  • Drop support for Safari versions less than 14. If you wish to test against Safari v10-v13 please continue to use Chai 4.
  • Drop support for EdgeHTML. If you wish to test against Edges older than 18 (as in, not Chromium Edge) please continue to use Chai 4.
  • Drop support for Firefox versions less than 102. If you wish to test against Firefox 60 through to 101 please continue to use Chai 4.
  • Drop support for Chrome versions less than 108. If you wish to test against Chrome 68 through 107 please continue to use Chai 4.

v4.3.7

Version v4.3.7

What’s Changed

  • fix: deep-eql bump package to support symbols comparison by @snewcomer in https://github.com/chaijs/chai/pull/1483

Full Changelog: https://github.com/chaijs/chai/compare/v4.3.6…v4.3.7

Version v4.3.6

Update loupe to 2.3.1

Version v4.3.5

  • build chaijs fca5bb1
  • build(deps-dev): bump codecov from 3.1.0 to 3.7.1 (#1446) 747eb4e
  • fix package.json exports 022c2fa
  • fix: package.json - deprecation warning on exports field (#1400) 5276af6
  • feat: use chaijs/loupe for inspection (#1401) (#1407) c8a4e00

https://github.com/chaijs/chai/compare/v4.3.4…v4.3.5

Version v4.3.4

This fixes broken inspect behavior with bigints (#1321) (#1383) thanks @vapier

4.3.3 / 2021-03-03

Version 4.3.3

This reintroduces Assertion as an export in the mjs file. See https://github.com/chaijs/chai/pull/1378 & https://github.com/chaijs/chai/issues/1375

4.3.2 / 2021-03-03

Version 4.3.2

This fixes a regression in IE11. See https://github.com/chaijs/chai/pull/1380 & https://github.com/chaijs/chai/issues/1379

4.3.1 / 2021-03-02

Version 4.3.1

This releases fixed an engine incompatibility with 4.3.0

The 4.x.x series of releases will be compatible with Node 4.0. Please report any errors found in Node 4 as bugs, and they will be fixed.

The 5.x.x series, when released, will drop support for Node 4.0

This fix also ensures pathval is updated to 1.1.1 to fix CVE-2020-7751

4.3.0 / 2021-02-04

Version 4.3.0

This is a minor release.

Not many changes have got in since the last release but this one contains a very important change (#1257) which will allow jest users to get better diffs. From this release onwards, jest users will be able to see which operator was used in their diffs. The operator is a property of the AssertionError thrown when assertions fail. This flag indicates what kind of comparison was made.

This is also an important change for plugin maintainers. Plugin maintainers will now have access to the operator flag, which they can have access to through an util method called getOperator`.

Thanks to all the amazing people that contributed to this release.

New Features

  • Allow contain.oneOf to take an array of possible values (@voliva)
  • Adding operator attribute to assertion error (#1257) (@rpgeeganage)
  • The closeTo error message will now inform the user when a delta is required (@eouw0o83hf)

Docs

  • Add contains flag to oneOf documentation (@voliva)

Tests

  • Make sure that useProxy config is checked in overwriteProperty (@vieiralucas)
  • Add tests for contain.oneOf (@voliva )

Chores

  • Update mocha to version 6.1.4
  • Add node v10 and v12 to ci (@vieiralucas)
  • Drop support for node v4, v6 and v9 (@vieiralucas)
  • Fix sauce config for headless chrome (@meeber)
  • Update dev dependencies (@meeber)
  • Removed phantomjs dependency (#1204)

4.2.0 / 2018-09-25

Version 4.2.0

This is a minor release. Thank you to all of our contributors and users!

New Features

  • feat(assertions): add ‘still’ language chain (#1194; @ScottRudiger)
  • .lengthOf for Maps and Sets (#1110, #1131; @asbish)
  • feat: Add the assert.fail([message]) interface (#1116, #1117; @s-leroux)

Bug Fixes

  • fix: remove Chai frames from .deep.equal stack (#1124; @meeber)
  • add ‘catch’ keyword to proxyExcludedKeys (#1050, #1101; @generalandrew)
  • property assertion should only accept strings if nested (#1043, #1044; @solodynamo)
  • fix: Make tests pass with --use_strict (#1034, #1040; @shvaikalesh)

Performance

  • perf: Optimize proxify and stringDistance (#1098; @sophiebits)
  • fix: Avoid repeated String#slice calls in stringDistance (#1095; @bmeurer)

Style

  • Fix typos and remove trailing whitespaces (#1042; @simonewebdesign)
  • Remove unnecessary code (#1049; @abetomo)
  • Fix variable declaration (#1048; @abetomo)

Tests

  • test(assert): increase coverage (#1084, #1085; @brutalcrozt)
  • test: stop modifying globals in Proxy tests (#1144; @meeber)

Docs

  • Fix unbalanced quotes in assert.notInclude example (#1200; @haykam821)
  • docs: fix bad .string example (#1156, #1157; @meeber)
  • fixed package npm url (#1151; @wadie)
  • Spelling (#1145; @jsoref)
  • docs: corrected spelling (#1141; @Powell-v2)
  • docs: fix wrong .property chaining examples (https://github.com/chaijs/chai/issues/193#issuecomment-360334369, #1130; @meeber)
  • docs: improve throws examples (#1113; @ColinEberhardt)
  • Fix typos (#1107; @tbroadley)
  • docs: correct .ok description (#1047; @shvaikalesh)

Chores

  • chore: update package-lock.json (#1198; @meeber)
  • Update mocha to the latest version (#1127)
  • chore: update dependencies (#1157; @meeber)
  • Update browserify to the latest version (#1135)
  • chore: update Node versions in Travis config (#1126; @meeber)
  • chore: remove Opera from Sauce config (#1125; @meeber)
  • chore: update dependencies (#1118; @meeber)
  • chore: update dependencies (#1074; @meeber)
  • Chore: change coverage service (coverall to codecov) (#927, #1073; @brutalcrozt)
  • chore: add package-lock.json (#1013; @meeber)

4.1.2 / 2017-08-31

Version 4.1.2

This release fixes a bug when running in certain environments, and includes a few minor documentation fixes.

Bug Fixes

  • fix: update deep-eql to version 3.0.0 (#1020)
  • fix: replace code causing breakage under strict CSP (#1032; @Alhadis)

Docs

  • docs: add missing assert parameters (#1017, #1023; @Hpauric)
  • docs: update year in license file (#1025; @yanca018)

4.1.1 / 2017-08-05

Version 4.1.1

This release includes a few bug and documentation fixes.

Bug Fixes

  • fix: .instanceof to allow DOM interfaces in IE11 (#1000, #1008; @meeber)
  • fix: .include to work with all objects (#1009, #1012; @meeber)

Docs

  • fix: correct hasAnyKeys comment error (#1014; @zenHeart)
  • docs: re-indent hasAnyKeys code (#1016; @keithamus)

4.1.0 / 2017-07-11

Version 4.1.0

This release includes one new feature and a few bug fixes.

New Features

  • Add ES6 collection support to include() (#970, #994; @shvaikalesh)

Bug Fixes

  • Allow dates for isBelow and isAbove assertions (#980, #990; @v1adko)
  • fix: check target’s type in .property assertion (#992; @meeber)

Chores

  • Add a missing var keyword found by lgtm.com (#988; @samlanning)
  • refactor: expectTypes to access ssfi flag (#993; @meeber)
  • Create CODEOWNERS (#1004; @keithamus)

4.0.2 / 2017-06-05

Version 4.0.2

We have another bugfix release, addressing some issues for WebPack 1 users.

Bug Fixes

  • Revert getting version information from package.json, some bundler tools like Webpack do not come default with json loaders despite Node being able to handle this. This change moves back to hardcoding the version number in the codebase. (#985, #986)

4.0.1 / 2017-05-31

Version 4.0.1

4.0.1

Of course, any major release cannot go without a quick bugfix release shortly after - and here’s ours!

Bug Fixes

  • Remove package.json browser field which was mistakenly added, and caused bundler tools like Browserify or Webpack to fail as it attempted to rebundle an already bundled file. (#978, #982)