Tony Gentilcore
Tony Gentilcore

Reputation: 203

Jest secure cookies?

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.

Upvotes: 2

Views: 2092

Answers (1)

Avram Tudor
Avram Tudor

Reputation: 1526

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

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

Upvotes: 1

Related Questions