DEV Community

Discussion on: Got an issue while running test with Jest on my typescript next js app

Collapse
 
kvsm profile image
Kevin Smith 🏴󠁧󠁢󠁳󠁣󠁴󠁿

You need to load your dotenv in your tests too. Try adding

beforeAll(async () => dotenvLoad())

...before your test.

Collapse
 
theprojectalpha profile image
The Project Alpha

Thanks,

it works with the code you proposed.

Hugo