From: Justin Wind Date: Sun, 11 May 2025 22:00:14 +0000 (-0700) Subject: stub contexts return values X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=eaecb71e6fc83d48da4ea19d8001ca1f2c6fb3a8;p=squeep-db-helper stub contexts return values --- diff --git a/test/stub.js b/test/stub.js index aa8f548..352d951 100644 --- a/test/stub.js +++ b/test/stub.js @@ -108,12 +108,12 @@ function stubCreator(Abstract, metadata = stubMetadata()) { this._sinonInit(); } - async context(fn) { - await fn({}); + async context(fn, ...args) { + return await fn({}, ...args); } - async transaction(dbCtx, fn) { - await fn(dbCtx); + async transaction(dbCtx, fn, ...args) { + return await fn(dbCtx, ...args); } _sinonInit() {