tinyspy 4.x
Use tinyspy ^4.0.0 as an ESM-only spying library in standalone TypeScript or JavaScript scripts.
- For
tinyspy@4.0.6- Verified
- 2026-09-08, 5 examples executed
- Package
@modootoday/pmcp-tinyspy@4.0.0
What it covers
- Package shape and import rule
- Standalone function spies
- Spying on object methods
- Recorded outcomes and controls
- Async spies
- Restoring all spies
- Constructors and internal exports
- What this skill does not cover
One example from this skill
This is the skill's own text, not a summary of it. It runs: that is what verifying means here.
import assert from 'node:assert/strict'
import { spy } from 'tinyspy'
const spied = spy((n: string) => n + '!')
assert.equal(spied('a'), 'a!')
assert.equal(spied.called, true)
assert.equal(spied.callCount, 1)
assert.deepEqual(spied.calls, [['a']])
assert.deepEqual(spied.results, [['ok', 'a!']])
assert.deepEqual(spied.returns, ['a!'])
spied.reset()
assert.equal(spied.called, false)
assert.equal(spied.callCount, 0)
assert.deepEqual(spied.calls, [])
What it did in the sandbox
Verifying this skill meant installing the package and running code against it with no route out. This is what happened, quoted from the run. The full ledger lists every package examined, including the ones that never became a skill.
-
prepare: huskythe package -
prepare: huskythe package
Getting it
With a subscription:
npx -y @modootoday/pmcp login
npx -y @modootoday/pmcp install @modootoday/pmcp-tinyspy
It installs as a dev dependency of your project, and the MCP server finds it there like any other skill.