I have an app that is preloading from images:
import { Asset } from "expo-asset"
/* .. */
useEffect(() => {
await Asset.loadAsync([
require("./assets/media/background.jpg"),
require("./assets/splash.png"),
])
}, [])
And I would like to test this component with Jest, but I get an error that Error: Module "1" is missing from the asset registry
. I was wondering what’s the best way to go around this? I couldn’t find an example of somebody mocking expo-asset, and if I try to do it myself I get even more errors like TypeError: Right-hand side of 'instanceof' is not callable
and then I wonder if I should be mocking the registry but I do not think that’s a good solution.