Skip to content

Nock tough-cookie, cookiejar #2284

Answered by mastermatt
37monkey asked this question in Q&A
Discussion options

You must be logged in to vote

Yes you can.

You need to make sure the response from the first request includes a set-cookie header, then the second request can assert the presence of a cookie header with the expected value.

https://github.com/nock/nock#specifying-reply-headers
https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mastermatt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants