Registry / testing / run-verify

run-verify

JSON →
library1.2.7jsnpmunverified

Library for proper test verifications in async contexts (callbacks, events, promises). Stable v1.2.7 with no breaking changes expected. Unlike basic expect assertions, run-verify ensures that async verifications are caught and reported properly by test runners, preventing uncaught exceptions causing confusing stack traces. Provides utilities like runVerify, asyncVerify, wrapCheck, and wrappers for runFinally/runTimeout/runDefer. Released under MIT license.

npm install run-verify
INSTALL
IMPORT
SIG · RUN-VERIFY
R
run-verify
testingjavascriptv1.2.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

runVerify
✓ import runVerify from 'run-verify'
✗ import { runVerify } from 'run-verify'
Default export; named imports used for others like asyncVerify, runFinally.
asyncVerify
✓ import { asyncVerify } from 'run-verify'
✗ import asyncVerify from 'run-verify'
Named export, not default.
wrapCheck
✓ import { wrapCheck } from 'run-verify'
Used to wrap custom check functions.

Demonstrates basic usage of runVerify with done callback and asyncVerify with async/await.

import runVerify from 'run-verify'; import { asyncVerify } from 'run-verify'; // Using with done callback it('should verify event', done => { const emitter = new EventEmitter(); const verify = runVerify(done); emitter.on('data', verify(data => { data.must.equal('hello'); })); emitter.emit('data', { must: { equal: (v) => v === 'hello' } }); }); // Using async/await async function test() { const result = await someAsyncFunc(); const verify = asyncVerify(); verify(result, (data) => { data.must.equal('hello'); }); }
Debug
Known issues
gotcharunVerify calls done() automatically after all verifications; do not call done() manually or it will double-invoke.
fix
Let runVerify handle the done callback; only call done() if you are not using runVerify.
affects: >=0.0.0
gotchaasyncVerify returns a promise that resolves when verification completes; if you omit await, the test may pass before verification finishes.
fix
Always await the promise returned by asyncVerify in async tests.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: runVerify is not a function
Importing runVerify as named export instead of default.
fix
Change import to: import runVerify from 'run-verify'
done() called multiple times in test
Calling done() manually after using runVerify, which already calls done.
fix
Remove manual done() call; runVerify handles it.
Upgrade
Version history
1.2.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
run-verify — npm install run-verify · libregistry