Jest module mocking #16945
-
Hello, I am attempting to write some integration tests, where I wish to mock and modify an API route function that is being imported and called with my page's Here is some pseudo code example of what I am trying to achieve: pages/index.js
tests/index.spec.js
Any help would be greatly appreciated, as this is quite important for our team to adopting nextjs. Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Managed to solve this with some jest mocks to override how nextjs is requiring it's webpackified modules:
|
Beta Was this translation helpful? Give feedback.
Managed to solve this with some jest mocks to override how nextjs is requiring it's webpackified modules: