From 264c25ba0cde7eb699b26c76b71803104607485a Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 8 Dec 2022 20:39:14 +0300 Subject: [PATCH] Fix removing polyfill --- test/index.test.js | 1 + test/react-native-polyfill.test.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/test/index.test.js b/test/index.test.js index e12aa5ef..d5044633 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -6,6 +6,7 @@ import * as node from '../index.js' test.before(() => { Object.defineProperty(global, 'crypto', { + configurable: true, value: { getRandomValues(array) { for (let i = 0; i < array.length; i++) { diff --git a/test/react-native-polyfill.test.js b/test/react-native-polyfill.test.js index 642e13d2..43bf4693 100644 --- a/test/react-native-polyfill.test.js +++ b/test/react-native-polyfill.test.js @@ -9,6 +9,7 @@ test.before(() => { } Object.defineProperty(global, 'crypto', { + configurable: true, value: { getRandomValues(array) { for (let i = 0; i < array.length; i++) { @@ -22,6 +23,7 @@ test.before(() => { test.after(() => { delete global.navigator + delete global.crypto }) test('works with polyfill', () => {