{"_id":"@anyhook/testing","_rev":"3-eafe45b5fa81324637df85ec250df5f7","name":"@anyhook/testing","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.0":{"name":"@anyhook/testing","version":"0.2.0","keywords":["anyhook","testing","mock","in-memory"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyhook/testing@0.2.0","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"dist":{"shasum":"cad5bc8f547e80704739f0ae4f1467b8e19ca223","tarball":"https://registry.npmjs.org/@anyhook/testing/-/testing-0.2.0.tgz","fileCount":17,"integrity":"sha512-28HZfVXrGOx4CrXjv+KEBpjSoT2tXH85ooM75HxE4iE6pTTpJkbSolIpJHtn+Lw8sUFxp2oOml+ugKt0f0XRqQ==","signatures":[{"sig":"MEUCIQD7oEXxxKeS7XU21X7KgidKQZokJ1ASh8kHg9COklHu/AIgXBp/w4XODVC+Av4cXS8MEhXJ7Mzps05/uAs4SjNiy/E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25000},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b52f20c74ba626bcc43682bc8e746a9ca4b40b69","scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_npmVersion":"10.9.2","description":"In-memory transport/state/scheduler + scriptable MockReceiver for testing anyhook engines","directories":{},"_nodeVersion":"22.17.0","dependencies":{"@anyhook/core":"0.2.0","@anyhook/signing":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"peerDependencies":{"@anyhook/core":"0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/testing_0.2.0_1784916192016_0.3739215950389043","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@anyhook/testing","version":"0.2.1","keywords":["anyhook","testing","mock","in-memory"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyhook/testing@0.2.1","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"dist":{"shasum":"d34cd49ab70598ecb9c8eaaa3f608d0fd62c6413","tarball":"https://registry.npmjs.org/@anyhook/testing/-/testing-0.2.1.tgz","fileCount":17,"integrity":"sha512-ayfcAdkmVUZ9NWRBKIJYbsPMhMqA7Va2rZOUD3LyjownpM7KkXuq13LJ7GcAc6rg5B1ToAuwPoT/gdvAYH1QUg==","signatures":[{"sig":"MEQCIEqEWcU8qbWDVCZPjjvIq5VMIHYvvdimrt60o7ALCnTuAiAEZOlao7licKjRE20tKnmIPD7Fk7e6Y2byKWXmyPGzSw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25000},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b52f20c74ba626bcc43682bc8e746a9ca4b40b69","scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_npmVersion":"10.9.2","description":"In-memory transport/state/scheduler + scriptable MockReceiver for testing anyhook engines","directories":{},"_nodeVersion":"22.17.0","dependencies":{"@anyhook/core":"0.2.1","@anyhook/signing":"0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"peerDependencies":{"@anyhook/core":"0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/testing_0.2.1_1784916764033_0.7869618520714261","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@anyhook/testing","version":"0.2.2","description":"In-memory transport/state/scheduler + scriptable MockReceiver for testing anyhook engines","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","build:types":"tsc --emitDeclarationOnly --outDir dist","test":"bun test","typecheck":"tsc --noEmit","clean":"rm -rf dist coverage"},"dependencies":{"@anyhook/core":"0.2.2","@anyhook/signing":"0.2.2"},"peerDependencies":{"@anyhook/core":"0.2.2"},"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"keywords":["anyhook","testing","mock","in-memory"],"license":"MIT","author":"Shantanu Sharma","publishConfig":{"access":"public"},"_id":"@anyhook/testing@0.2.2","_integrity":"sha512-bzme3oMqTZCOCwPReRXd+F96I51mjZtGEguJPTGdvPXQbayHyT0jV2TxstaA+7BTiSfLA+CI00hB2adA+M9dXw==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"6fb7532d4bf405caf000c19cebb95887a78d5581","dist":{"integrity":"sha512-bzme3oMqTZCOCwPReRXd+F96I51mjZtGEguJPTGdvPXQbayHyT0jV2TxstaA+7BTiSfLA+CI00hB2adA+M9dXw==","shasum":"6fb7532d4bf405caf000c19cebb95887a78d5581","tarball":"https://registry.npmjs.org/@anyhook/testing/-/testing-0.2.2.tgz","fileCount":17,"unpackedSize":24970,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBvJCWw8dvyWih327kNK1Ki/RkW+VZMe8EAifCsdxg9SAiEAllEK9PNzDk0+a3LYSNbbVzomgSKsFsPPBP31qx4YNeg="}]},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"directories":{},"maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/testing_0.2.2_1788790449951_0.23779145217001885"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-24T18:03:11.869Z","modified":"2026-09-07T14:14:10.416Z","0.2.0":"2026-07-24T18:03:12.182Z","0.2.1":"2026-07-24T18:12:44.185Z","0.2.2":"2026-09-07T14:14:10.084Z"},"author":"Shantanu Sharma","license":"MIT","keywords":["anyhook","testing","mock","in-memory"],"description":"In-memory transport/state/scheduler + scriptable MockReceiver for testing anyhook engines","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"readme":"# @anyhook/testing\n\nIn-memory test doubles for [anyhook](https://github.com/sns45/anyhook): drive the engine to real outcomes without any infrastructure.\n\n## Install\n\n```bash\nnpm i -D @anyhook/testing\n```\n\n## Overview\n\n- `MemoryTransport` / `MemoryStateStore` / `MemoryScheduler` — in-process implementations of the core ports (tenant-scoped).\n- `TestClock` + `seededRng` — deterministic time and jitter.\n- `MockReceiver` — a scriptable `HttpClient`: `ok` / `failThenOk(n)` / `permanent(status)` / `timeout` / `slow(ms)`, recording every call.\n- `runDeliveries(...)` — drives the drain + scheduled-retry loop to quiescence over the virtual clock.\n\n```ts\nimport { MemoryTransport, MemoryStateStore, MemoryScheduler, MockReceiver, TestClock, runDeliveries } from '@anyhook/testing';\n\nconst clock = new TestClock(0);\nconst transport = new MemoryTransport();\nconst receiver = new MockReceiver(clock).on(url, Receiver.failThenOk(1));\n// wire into new WebhookEngine({...}), then:\nawait runDeliveries({ transport, scheduler, clock });\n```\n\nBackbone of anyhook's integration tests (message isolation, delivery matrix, cross-tenant no-leak). MIT.\n","readmeFilename":"README.md"}