I am trying to test dynamic import in nextjs version 10.2.3, i tried using jest-next-dynamic library which avoid throwing error
TypeError: require.resolveWeak
but when i debug the component in jest test case i get below output and cannot get real component that should be loaded
<ForwardRef(LoadableComponent) .../>
My test case
it('should render Image component from next/Image', () => {
await preloadAll();
defaultProps = getDefaultProps(imgSrcFromAssetsLocation);
const ContainerImage = shallow(<ContainerImage { ...defaultProps } />);
console.log(ContainerImage.debug());
expect(ContainerImage.prop('layout')).toEqual('responsive');
});