@noego/testing 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1327,10 +1327,10 @@ function resolveTestOverlays(stub, catalogs) {
1327
1327
  const result = [];
1328
1328
  for (const entry of stubEntries(stub)) {
1329
1329
  let candidates = catalogs.filter((c) => owns(c, entry) && (entry.owner === void 0 || c.owner === entry.owner));
1330
- if (candidates.length === 0 && entry.kind !== "middleware" && entry.kind !== "load" && typeof entry.target === "function") {
1330
+ if (candidates.length === 0 && entry.kind !== "middleware" && entry.kind !== "load" && (typeof entry.target === "function" || entry.kind === "value")) {
1331
1331
  const fallback = catalogs.filter((c) => entry.owner === void 0 || c.owner === entry.owner);
1332
1332
  if (fallback.length === 1) {
1333
- const synthetic = { token: entry.target, kind: "class", lifetime: "singleton", implementation: entry.target, dependencies: [] };
1333
+ const synthetic = typeof entry.target === "function" ? { token: entry.target, kind: "class", lifetime: "singleton", implementation: entry.target, dependencies: [] } : { token: entry.target, kind: "value", lifetime: "singleton", implementation: entry.replacement, dependencies: [] };
1334
1334
  candidates = [{ ...fallback[0], bindings: [...fallback[0].bindings, synthetic] }];
1335
1335
  }
1336
1336
  }