There are many things to have to consider when you want to mock ES module.
I spent a lot of time fixing all of the issues I had around mocking ESM modules in both Javascript and Typescript. That's why I decided to create a repository to show a complete full-working example. You can have a look if you want: https://github.com/habibseifzadeh/jest-esm-mock-examples