@navinc/base-react-components
Version:
Nav's Pattern Library
12 lines (9 loc) • 351 B
JavaScript
import crypto from 'crypto'
delete process.env.CLIENT_COOKIE_DOMAIN
// Mock crypto.getRandomValues for Jest
// https://stackoverflow.com/questions/52612122/how-to-use-jest-to-test-functions-using-crypto-or-window-mscrypto
Object.defineProperty(globalThis, 'crypto', {
value: {
getRandomValues: (arr) => crypto.randomBytes(arr.length),
},
})