I haven’t yet done this myself, but ran into a similar concern with testing an app using specialized hooks. (I’m assuming it’s the hooks and their expected context that is giving you trouble.)
import { useHook } from 'some-lib'
const MyComponent = (...