-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
next@beta-31 breaks Jest tests #1204
Comments
Removing This is a temporary work around. Expected that prefetch should not generate the Additionally, the message |
+1, It's really annoying to have to disable tests for CI Production builds to get prefetch enabled on prod. |
+1 had to remove |
@Zaiban pulling tests from CI because 1 feature is buggy 😱 what else can you do? @khrome83 's suggestion of removing prefetch altogether seems more reasonable but then your app slows on navigation. Surprised more people aren't experiencing problems with this, especially as it was flagged 2 months ago.. maybe they aren't testing (with Jest)? |
Maybe not the most elegant solution but this is working for me and hopefully just temporary: <Link href="/" prefetch={process.env.NODE_ENV !== 'test'} >
<a>Home</a>
</Link> |
@kunal-mandalia I've been using |
@Zaiban @mkitt good idea (as a workaround till its fixed). Using your ideas, I'm using a global defined through
and then calling Finally change npm test script to |
The latest beta breaks Jest tests really bad.
Version: next@beta-31
Any test that renders a component that contains the
next/link
will fail.This breaks the react-test-render method of creating components. This did not happen with the previous version of
next/link
ornext/prefetch
.The text was updated successfully, but these errors were encountered: