tldraw/packages/tlsync-client/setupJest.js
2023-04-25 12:01:25 +01:00

10 lines
260 B
JavaScript

window.crypto = {
// required by nanoid
// if we need more of the crypto apis, just add a proper mock here
getRandomValues: function (array) {
for (var i = 0; i < array.length; i++) {
array[i] = Math.floor(Math.random() * 256)
}
return array
},
}