stub contexts return values
authorJustin Wind <justin.wind+git@gmail.com>
Sun, 11 May 2025 22:00:14 +0000 (15:00 -0700)
committerJustin Wind <justin.wind+git@gmail.com>
Sun, 11 May 2025 22:00:14 +0000 (15:00 -0700)
test/stub.js

index aa8f54801191cb39a59714067471a7e9afb31e36..352d9519ded35525ac52f9da63ce5e6c1d76f490 100644 (file)
@@ -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() {