@noego/testing 0.7.3 → 0.7.4

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.
@@ -1,10 +1,10 @@
1
+ import {
2
+ followFetchRedirects
3
+ } from "../chunk-YX44DAOH.js";
1
4
  import {
2
5
  acquireNativeBrowser,
3
6
  startSharedBrowser
4
7
  } from "../chunk-P26IJDOI.js";
5
- import {
6
- followFetchRedirects
7
- } from "../chunk-YX44DAOH.js";
8
8
  import "../chunk-DGUM43GV.js";
9
9
 
10
10
  // src/browser/lifecycle.ts
package/dist/index.cjs CHANGED
@@ -385,6 +385,7 @@ function recordOutcome(call, outcome, threw) {
385
385
  else call.result = outcome;
386
386
  return outcome;
387
387
  }
388
+ var pristineMethods = /* @__PURE__ */ new WeakMap();
388
389
  function createMethodDecorator(registry) {
389
390
  const wrappers = /* @__PURE__ */ new WeakMap();
390
391
  return function decorate(instance, token2) {
@@ -406,8 +407,11 @@ function createMethodDecorator(registry) {
406
407
  }
407
408
  }
408
409
  if (Object.isExtensible(instance)) {
410
+ const pristine = pristineMethods.get(instance) ?? /* @__PURE__ */ new Map();
411
+ pristineMethods.set(instance, pristine);
409
412
  for (const [method, { entryKey, descriptor }] of effective) {
410
- const original = instance[method];
413
+ const original = pristine.get(method) ?? instance[method];
414
+ pristine.set(method, original);
411
415
  const wrapped = buildMethodWrapper(instance, method, descriptor, registry.state(entryKey, method), original);
412
416
  Object.defineProperty(instance, method, { value: wrapped, configurable: true, writable: true, enumerable: false });
413
417
  }