# testdouble/testdouble.js

A minimal test double library for TDD with JavaScript

Repository: https://github.com/testdouble/testdouble.js
Canonical: https://ross.abutalabs.com/products/testdoublejs
Language: JavaScript
License: MIT
License Family: permissive
Topics: testdouble, testing-tools, mocking, spies, sinon
Last push: 2024-03-21T19:42:55+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4013, "days_push": 895, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1428, forks 139 (observed 2026-08-28T04:04:42.029229+00:00)

## What it is
testdouble.js (td.js) is a minimal, opinionated test double library for JavaScript that provides stubbing, spying, and verification for test-driven development. It works in both Node.js and browsers and is agnostic to the test framework used.

## Use cases
- mock dependencies in JavaScript unit tests
- stub functions and objects for TDD
- spy on function calls and verify interactions
- replace sinon.js with a simpler mocking library
- fake out API or module dependencies in browser tests

## When to choose
- you practice TDD and want terse, readable test doubles
- you want a test-framework-agnostic mocking library (Jest, Mocha, Jasmine, Tape, etc.)
- you prefer a minimal API over heavyweight mocking frameworks

## When to avoid
- you need deep integration with a specific framework's mocking ecosystem
- you need extensive features like fake timers or module mocking built in
- you need a library under very active development

## Facets
- artifact type: library
- maturity: maintenance
- function: testing, mocking
- domain: testing, developer-tools
- platform: browser, cross-platform
- tags: test-doubles, tdd, spies, stubs, sinon-alternative, test-framework-agnostic, javascript, nodejs

## Member repositories
- testdouble/testdouble.js (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:42.029229+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-30T04:37:19.952057+00:00, confidence not recorded.
  - readme: https://github.com/testdouble/testdouble.js (fetched 2026-08-28T04:04:42.029229+00:00, sha efeafd0d6db0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
