Explorar o código

chore: fix Blob test in latest nodejs

tophf %!s(int64=3) %!d(string=hai) anos
pai
achega
2c8795f3dc
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      test/mock/polyfill.js

+ 4 - 2
test/mock/polyfill.js

@@ -27,9 +27,11 @@ global.chrome = {
 if (!window.Response) window.Response = { prototype: {} };
 const domProps = Object.getOwnPropertyDescriptors(window);
 for (const k of Object.keys(domProps)) {
-  if (k.endsWith('Storage') || k in global) delete domProps[k];
+  // Skipping ***Storage and native global methods
+  if (k.endsWith('Storage') || /^[a-z]/.test(k) && (k in global)) {
+    delete domProps[k];
+  }
 }
-delete domProps.performance;
 Object.defineProperties(global, domProps);
 global.__VAULT_ID__ = false;
 Object.assign(global, require('#/common/safe-globals'));