Next.js Discord

Discord Forum

How can we use next/font/local with Cypress component tests?

Unanswered
Chippiparai posted this in #help-forum
Open in Discord
ChippiparaiOP
I've imported next/font/local into the testing environment, and it seems to be inserting the className into the wrapper as it should (e.g. __className_ecfe78) but the font isn't at the url it's looking for (e.g. http://localhost:8080/_next/static/media/d471c0bc73f04b29-s.p.woff2). Is it possible to use next/font in this scenario outside of Next, or is the best answer to spoof it and load the fonts differently?

0 Replies