expect/should Style & Core Assertions Three Styles Chai supports assert (TDD-style function calls), expect, and should (both BDD-style chainable syntax). Mocha ships with no assertion library of its own, which is why Cha…
ReadErrors, Collections & Plugins Asserting Thrown Errors // pass the function reference — do NOT call it inside expect() expect(() => myFunction()).to.throw(Error); expect(() => validate(input)).to.throw(ValidationError, 'r…
ReadSave this stack to your personal DevRecall — add your own notes, track what you're learning, and share what you know with the community.
Get started — free forever