-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Bug]: Jest does not properly resolve href attributes with relative URLs #11861
Comments
Essentially jsdom/jsdom#1388 (comment), you cannot override |
Hmm... right now I'm working around the problem by using a custom Is there any easy and practical way to make some tests use one |
https://jestjs.io/docs/configuration#projects-arraystring--projectconfig with separate configs should work |
I looked at that |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
27.1.1
Steps to reproduce
npm i
npm run test
Expected behavior
I expect the
expect(link.href).toBe("https://example.com/");
line to pass.Actual behavior
The line doesn't pass. I get this:
Additional context
It seems that jest (or maybe jsdom) is not properly resolving the URL in the link's
href
attribute.I tried setting the current URL using the top 3 answers to this question and none of them worked.
I also experience this bug in Jest 26.4.2.
Environment
The text was updated successfully, but these errors were encountered: