tldraw/packages/tlsync-client/setupJest.js

11 lines
260 B
JavaScript
Raw Normal View History

2023-04-25 11:01:25 +00:00
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
},
}