diff --git a/jest.config.js b/jest.config.js index 5961124..a88be9e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + setupFilesAfterEnv: ['/src/tests/setup.js'], moduleDirectories: ['node_modules', 'src'], snapshotSerializers: [], moduleNameMapper: { diff --git a/src/tests/setup.js b/src/tests/setup.js new file mode 100644 index 0000000..43a7f3b --- /dev/null +++ b/src/tests/setup.js @@ -0,0 +1,5 @@ +const nodeCrypto = require('crypto'); + +window.crypto = { + getRandomValues: buffer => nodeCrypto.randomFillSync(buffer), +};