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
Avatar
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.
Image
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
Image
View full answer

1 Reply

Avatar
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
Image
Answer