# chaijs/sinon-chai

Extends Chai with assertions for the Sinon.JS mocking framework.

Repository: https://github.com/chaijs/sinon-chai
Canonical: https://ross.abutalabs.com/products/sinon-chai
Language: JavaScript
License: NOASSERTION
License Family: other
Last push: 2025-08-22T10:58:39+00:00

## Health v2 (maintenance only)
Score: 41/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 38, release rhythm 12, longevity 100
- inputs: {"age_days": 5315, "days_push": 376, "days_rel": 376, "gap_med": null, "n_releases_24m": 1}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1089, forks 103 (observed 2026-08-28T04:03:32.773179+00:00)

## What it is
A Chai plugin that adds custom assertions for the Sinon.JS spy, stub, and mocking framework. It lets you write spy assertions in idiomatic Chai should/expect syntax instead of Sinon's own assertion API.

## Use cases
- assert a spy was called with specific arguments using chai expect syntax
- verify a stub was called exactly once in a unit test
- write readable sinon spy assertions in mocha tests
- check call order of spies with calledBefore/calledAfter
- test that a callback was never invoked

## When to choose
- you already use Chai for assertions and Sinon.JS for spies, stubs, or mocks
- you want failure messages that read naturally in BDD-style tests

## When to avoid
- you use Jest or another test framework with built-in mocking
- you don't use Chai or Sinon.JS in your test stack

## Facets
- artifact type: plugin
- maturity: stable
- function: testing, mocking
- domain: testing, developer-tools
- platform: browser
- tags: chai, sinon, spies, stubs, assertions, unit-testing, nodejs, javascript

## Member repositories
- chaijs/sinon-chai (main) score 41

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:32.773179+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:49:17.160196+00:00, confidence not recorded.
  - readme: https://github.com/chaijs/sinon-chai (fetched 2026-08-28T04:03:32.773179+00:00, sha 98c8476a7839)
  - registry_npm: https://registry.npmjs.org/sinon-chai (fetched 2026-08-29T12:51:32.504161+00:00, sha 76ccd7c975d9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
