testing UI of next.js app using jest without involving getStaticProps
I have a simple Next 14 page router application. and I want to test the UI using jest without involving getStaticProps
function by passing props to page. I try to use process.env.NODE_ENV
for returning from getStaticProps
in testing environment but it looks like that in the getStaticProps
the process.env.NODE_ENV
never be test
even while Execution of npm test
, because I get error about database, but the code in testing environment should skip that part