next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Set `__NEXT_NEW_LINK_BEHAVIOR` in Jest tests when `newNextLinkBehavior` is true

Open TomerAberbach opened this issue 2 years ago • 1 comments

Fixes #40463

Could use some help figuring out where to add a test! I looked around and found jest-next-swc.test.ts, but I don't think I can use that to test this fix. Anyways, from my local testing this PR seems to fix the issue.

TomerAberbach avatar Sep 20 '22 01:09 TomerAberbach

This is some awesome news @TomerAberbach :) thank you so much for looking into this, much appreciated!

terrymun avatar Sep 21 '22 12:09 terrymun

This is some awesome news @TomerAberbach :) thank you so much for looking into this, much appreciated!

No problem! I probably should have mentioned, in the meantime you should be able to work around the issue by manually setting the __NEXT_NEW_LINK_BEHAVIOR environment variable to true for your Jest tests.

TomerAberbach avatar Sep 21 '22 23:09 TomerAberbach