# mfncooper/mockery

Simplifying the use of mocks with Node.js

Repository: https://github.com/mfncooper/mockery
Canonical: https://ross.abutalabs.com/products/mfncooper-mockery
Language: JavaScript
License: NOASSERTION
License Family: other
Archived: true
Last push: 2023-08-16T20:23:55+00:00

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

## Adoption (not part of the score)
Stars 1097, forks 59 (observed 2026-08-28T04:03:34.730116+00:00)

## What it is
A Node.js library that intercepts require() calls so mocks or substitutes can be injected in place of real modules during unit testing. It is not a mocking framework itself but a helper for hooking mocks from any framework into the module loading system.

## Use cases
- inject mocks into require calls for unit tests
- replace node modules with test doubles
- stub dependencies in node.js unit tests
- isolate code under test from its dependencies
- control the require cache during testing

## When to choose
- you need to mock modules loaded via require in Node.js
- you want a framework-agnostic way to wire in test doubles
- you need fine control over the module cache in tests

## When to avoid
- you are testing ES modules with import statements
- you want a full mocking framework with assertion helpers
- you need an actively developed solution with modern Node support

## Facets
- artifact type: library
- maturity: maintenance
- function: mocking, testing
- domain: testing, developer-tools, backend
- platform: -
- tags: require-interception, module-cache, unit-testing, test-doubles, nodejs, javascript

## Member repositories
- mfncooper/mockery (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:34.730116+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:46:36.211757+00:00, confidence not recorded.
  - readme: https://github.com/mfncooper/mockery (fetched 2026-08-28T04:03:34.730116+00:00, sha 9cd9f7ac7637)
  - registry_npm: https://registry.npmjs.org/mockery (fetched 2026-08-29T12:49:48.862074+00:00, sha 838a240eb192)
- Data as of 2026-08-30T08:39:29.467469+00:00.
