A New jQuery Plugin for Chai
length in ways that changes the underlying Chai API.
With that motivation in mind, I hacked together a quick jQuery plugin,
chai-jq for Chai that has a separate
$-prefixed namespace to avoid collisions with existing Chai assertions, and put the project up on GitHub.
The chai-jq Plugin
- Browser: Via a standard
- Browser + AMD: Via an AMD library like RequireJS.
- Node.js + JsDom: In Node.js using the JsDom browser environment emulator.
In terms of what
chai-jq provides, here is a brief tour of the API (stolen from the project docs):