Files
extension/jest/setupEnv.js
T
Jaco b2f4ab0c00 0.44.9 (#1212)
* 0.44.9

* lint fixes
2023-02-19 15:56:27 +02:00

17 lines
446 B
JavaScript

// Copyright 2017-2023 @polkadot/extension authors & contributors
// SPDX-License-Identifier: Apache-2.0
import nodeCrypto from 'crypto';
import { TextDecoder } from '@polkadot/x-textencoder/node';
import { TextEncoder } from '@polkadot/x-textencoder/node';
window.crypto ??= {
getRandomValues: function (buffer) {
return nodeCrypto.randomFillSync(buffer);
}
};
global.TextDecoder ??= TextDecoder;
global.TextEncoder ??= TextEncoder;