Next.js Discord

Discord Forum

Deployment fails due to ReferenceError: test is not defined

Answered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
I've attached below an image displaying an error because of jest. I'm not sure what I'm missing. I've already ran pnpm run build and I get the same error. Not sure if I have to add anything to any configuration file.
Answered by Transvaal lion
I had to move my .test.ts files to __tests__ in the root folder and it worked.

https://nextjs.org/docs/app/building-your-application/testing/jest
View full answer

1 Reply

Transvaal lionOP
I had to move my .test.ts files to __tests__ in the root folder and it worked.

https://nextjs.org/docs/app/building-your-application/testing/jest
Answer