开玩笑的安全cookie? [英] Jest secure cookies?

查看:136
本文介绍了开玩笑的安全cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Jest 测试已设置为在CI上运行时模拟我的后端响应,但环境变量使它们可以在本地与实际后端运行.

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.

问题在于,我们现在已将身份验证切换为使用安全的,仅使用HTTP的Cookie.是否有可能导致Jest配置jsdom以尊重cookie?

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?

认为 jsdom的cookieJar config 也许可以解决问题,但无法弄清楚如何通过玩笑来配置它.

I think jsdom's cookieJar config might do the trick, but can't figure out how to configure that via jest.

推荐答案

似乎仍然没有为Jest配置jsdom的实现

Seems like there's still no implementation for configuring jsdom for Jest

https://github.com/facebook/jest/issues/2460

这篇关于开玩笑的安全cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆