import "@testing-library/jest-dom/extend-expect" ; import "jest-canvas-mock" ; import crypto from "crypto" ; const element = document . createElement ( "div" ) ; element . id = "root" ; document . body . appendChild ( element ) ; ( window as any ) . crypto = { getRandomValues : function ( buffer ) { return crypto . randomFillSync ( buffer ) ; } , } ;