{"id":41919,"library":"run-verify","title":"run-verify","description":"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.","status":"active","version":"1.2.7","language":"javascript","source_language":"en","source_url":"https://github.com/jchip/run-verify","tags":["javascript","proper","async","promise","callback","event","test","expect","verify"],"install":[{"cmd":"npm install run-verify","lang":"bash","label":"npm"},{"cmd":"yarn add run-verify","lang":"bash","label":"yarn"},{"cmd":"pnpm add run-verify","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export; named imports used for others like asyncVerify, runFinally.","wrong":"import { runVerify } from 'run-verify'","symbol":"runVerify","correct":"import runVerify from 'run-verify'"},{"note":"Named export, not default.","wrong":"import asyncVerify from 'run-verify'","symbol":"asyncVerify","correct":"import { asyncVerify } from 'run-verify'"},{"note":"Used to wrap custom check functions.","symbol":"wrapCheck","correct":"import { wrapCheck } from 'run-verify'"}],"quickstart":{"code":"import runVerify from 'run-verify';\nimport { asyncVerify } from 'run-verify';\n\n// Using with done callback\nit('should verify event', done => {\n  const emitter = new EventEmitter();\n  const verify = runVerify(done);\n  emitter.on('data', verify(data => {\n    data.must.equal('hello');\n  }));\n  emitter.emit('data', { must: { equal: (v) => v === 'hello' } });\n});\n\n// Using async/await\nasync function test() {\n  const result = await someAsyncFunc();\n  const verify = asyncVerify();\n  verify(result, (data) => {\n    data.must.equal('hello');\n  });\n}","lang":"typescript","description":"Demonstrates basic usage of runVerify with done callback and asyncVerify with async/await."},"warnings":[{"fix":"Let runVerify handle the done callback; only call done() if you are not using runVerify.","message":"runVerify calls done() automatically after all verifications; do not call done() manually or it will double-invoke.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Always await the promise returned by asyncVerify in async tests.","message":"asyncVerify returns a promise that resolves when verification completes; if you omit await, the test may pass before verification finishes.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'assert':25 'async':10,31,64 'asyncverifi':52 'basic':23 'break':19 'callback':12,66 'caught':34 'caus':44 'chang':20 'confus':45 'context':11 'ensur':29 'event':13,67 'except':43 'expect':21,24,69 'javascript':62 'librari':4 'licens':61 'like':50 'mit':60 'prevent':41 'promis':14,65 'proper':6,37,63 'provid':48 'releas':58 'report':36 'run':2,27 'run-verifi':1,26 'runfinally/runtimeout/rundefer':57 'runner':40 'runverifi':51 'stabl':15 'stack':46 'test':7,39,68 'trace':47 'uncaught':42 'unlik':22 'util':49 'v1.2.7':16 'verif':8,32 'verifi':3,28,70 'wrapcheck':53 'wrapper':55","created_at":"2026-06-04T18:54:44.888495+00:00","updated_at":"2026-06-04T18:54:44.888495+00:00","problems":[{"fix":"Change import to: import runVerify from 'run-verify'","cause":"Importing runVerify as named export instead of default.","error":"TypeError: runVerify is not a function"},{"fix":"Remove manual done() call; runVerify handles it.","cause":"Calling done() manually after using runVerify, which already calls done.","error":"done() called multiple times in test"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jchip/run-verify#readme","github":"https://github.com/jchip/run-verify","docs":null,"changelog":null,"pypi":null,"npm":"run-verify","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}