fixed crypto jest error

This commit is contained in:
Sean Macfarlane
2020-07-07 16:52:52 -04:00
parent 94fdabc84e
commit a1c59aaed0
2 changed files with 6 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
module.exports = {
setupFilesAfterEnv: ['<rootDir>/src/tests/setup.js'],
moduleDirectories: ['node_modules', 'src'],
snapshotSerializers: [],
moduleNameMapper: {

5
src/tests/setup.js Normal file
View File

@@ -0,0 +1,5 @@
const nodeCrypto = require('crypto');
window.crypto = {
getRandomValues: buffer => nodeCrypto.randomFillSync(buffer),
};