-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
CookieJar - Tough-Cookie breaking change #3419
Comments
You can configure the cookie jar via the jsdom options, it is called cookieJar. Here the example we are using for our jsdom jest environment:
You have to use a FQDN even for localhost otherwise you will run into salesforce/tough-cookie#248 bug. |
Only problem for us is that we are using Vitest which doesn't provide an interface (that I've seen) |
If tough-cookie is going to be picky about this now, it would seem that jsdom should configure their internal cookieJar to be loose and allow special domains by default, as that seems a common use case for testing is to use special use domains |
Hi, this had me spinning a few hours today. |
I'm confident tough-cookie will revert their breaking change. I have no plans to address this on the jsdom side; please direct your attention to their repository instead, to urge them to fix their breaking change sooner. |
If anyone still has trouble with the new 4.1.1 release, check your used url for your testing environment. It needs to be a full qualified domain name in case of localhost you can use localhost.local |
Have tried this config in "jsest.config.js" but getting the error "jsdom is not defined". |
Yes you have to require jsdom, but this is not required any more. With 4.1.2 there is another patch release which handles this case as well. |
ToughCookie just released a breaking change in a minor release and it's breaking all related tests using JSDom (when in localhost context)
Cause salesforce/tough-cookie#246
Blown up tests look like this:
Is it possible to provide the options required to the dependency?
Otherwise, recommend pinning this particular dependency to version 4.0 until you have a chance to update
The text was updated successfully, but these errors were encountered: