Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Add _saveCookies and jar #38

Closed
ghost opened this issue Oct 23, 2016 · 2 comments
Closed

Add _saveCookies and jar #38

ghost opened this issue Oct 23, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 23, 2016

Can we add _saveCookies and jar to the agent? This will do the trick. Would be happy to submit a PR.

  out.agent = function () {
    var agent = supertest.agent.apply(null, arguments);
    var _agent = wrap(agent);
    _agent._saveCookies = agent._saveCookies;
    _agent.jar = agent.jar;
    return _agent;
  };
@benesch
Copy link
Contributor

benesch commented Oct 25, 2016

Good catch! Fixed another way, since it turns out we should just inherit from the agent prototype chain to expose all such properties, rather than special-casing the two you listed. Thanks for the report!

@benesch
Copy link
Contributor

benesch commented Oct 25, 2016

Released as v4.0.1. Cheers!

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

No branches or pull requests

1 participant