问题
My Jest tests are setup to mock my backend response when run on CI, but an environment variable allows them to run against the real backend locally.
The problem is that we've now switched auth to use secure, http-only cookies. Is it possible to cause Jest to configure jsdom to respect cookies?
I think jsdom's cookieJar
config might do the trick, but can't figure out how to configure that via jest.
回答1:
Seems like there's still no implementation for configuring jsdom for Jest
https://github.com/facebook/jest/issues/2460
来源:https://stackoverflow.com/questions/40492664/jest-secure-cookies