-
I am importing and using react-modal from within my app without issue. However when I run my tests using jest as jsdom testEnvironment it fails to import coming back as undefined. When I switch to commonjs require importing react-modal does come back and works. I have many other imports all using esmodule syntax that work fine in my tests and only react-modal is coming back as undefined. What can I do? I run my package.json type as module and this issue happens whether I turn on or off esModuleInterop on typescript. Here's my jest.config.js
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This is really annoying (import problems)... If you are having problems, we are going to dig deep to find what is the problems. Can you, please, create an example so we can see what is going on? |
Beta Was this translation helpful? Give feedback.
Have you tried
import * as ReactModal from "react-modal";
?