Repository navigation
2.0.0
·
6 commits
to master
since this release
Note: This version is not published to npm. The 2.x line ships to npm starting at 2.0.1, which contains the same code. Install
chai-json-schema@2.0.1.
[2.0.0] - 2026-06-16
Breaking changes
-
Dropped support for chai < 5. The peer dependency is now
chai >= 5. -
chai.tv4is no longer set. The tv4 instance is now exposed on the plugin itself instead of on the chai object.Why: chai 5 and 6 are ES modules. The module namespace object exported by an ES module is sealed — new properties cannot be added to it. Setting
chai.tv4 = ...from a plugin silently fails in these versions, making the tv4 configuration API completely broken for anyone on chai 5+.Migrate configuration calls:
const chai = require('chai'); // before chai.use(require('chai-json-schema')); chai.tv4.addSchema('http://example.com/schema', schema); chai.tv4.cyclicCheck = true; // after const chaiJsonSchema = require('chai-json-schema'); chai.use(chaiJsonSchema); chaiJsonSchema.tv4.addSchema('http://example.com/schema', schema); chaiJsonSchema.tv4.cyclicCheck = true;
The
jsonSchemaandnotJsonSchemaassertion methods themselves are unchanged.
Other changes
- Dropped Node 18 support (
enginesis now>= 20). Node 18 cannotrequire()ES modules, which chai 5+ are. - Removed
serialize-javascriptoverride (mocha now ships a non-vulnerable version directly).