Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parses set-cookie header differently than superagent when run inside jest #460

Open
timwis opened this issue Feb 12, 2018 · 1 comment
Open

Comments

@timwis
Copy link

timwis commented Feb 12, 2018

Hi folks, I've got quite a peculiar bug that I've isolated in this repo. My server (koa) returns two set-cookie headers. When run standalone, both superagent and supertest parse the two set-cookie headers into separate items in an array.

node request.js

supertest [ 'koa:sess=foo; path=/; httponly',
  'koa:sess.sig=E3XmR2LMmP11O418i_oXS61zGi0; path=/; httponly' ]
superagent [ 'koa:sess=foo; path=/; httponly',
  'koa:sess.sig=E3XmR2LMmP11O418i_oXS61zGi0; path=/; httponly' ]

When run in the context of jest, supertest behaves differently, combining the two set-cookie headers.

npm test

superagent [ 'koa:sess=foo; path=/; httponly',
  'koa:sess.sig=E3XmR2LMmP11O418i_oXS61zGi0; path=/; httponly' ]
supertest [ 'koa:sess=foo; path=/; httponly,koa:sess.sig=E3XmR2LMmP11O418i_oXS61zGi0; path=/; httponly' ]

The repo has a reproduction. Any idea how this could be happening? Am I crazy?

@crux153
Copy link

crux153 commented Mar 11, 2018

There seems to be an issue with jest. See #413 and jestjs/jest#3547, jestjs/jest#2549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants