Jest secure cookies?

北城余情 提交于 2019-12-24 06:49:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!