Link component doesn't pass props to anchor in Jest with babel-jest #43508
Labels
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Testing
Related to testing with Next.js.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Happens in Jest
How are you deploying your application? (if relevant)
N/A
Describe the Bug
Props passed to the Link component don't appear on the rendered anchor element when testing with Jest, and specifically only with babel-jest.
The following test:
Fails with
Testing setup is set up following the Jest with Reach Testing Library guide. Specifically with babel! Rust compiler doesn't have this issue
Expected Behavior
The test should pass, since the anchor element should receive the props passed to it in a testing environment.
The test should pass with babel configuration, as it does with the Rust compiler.
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/kirjai/literate-octo-computing-machine
To Reproduce
run
npm test
after installing dependenciesThe text was updated successfully, but these errors were encountered: