How to mock gatsby's @reach/router?

Viewed 172

I'm having trouble mocking @reach/router in Gatsby. Jest isn't able to find the package.

Cannot find module '@reach/router' from 'src/core/util/redirects.test.js'

      3 |
      4 | jest.mock('gatsby')
    > 5 | jest.mock('@reach/router')

When looking at node_modules, the only reach-router package present is @gatsbyjs/reach-router. How is webpack resolving this import?

How do I tell jest where that package is located?

Thanks in advance!

0 Answers
Related