GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added request.agent(app) support by steff-mueller · Pull Request #54 · forwardemail/supertest

Conversation

@steff-mueller

@steff-mueller steff-mueller commented Mar 14, 2013

Copy link
Copy Markdown
Contributor

I added request.agent(app) support.
See following test:

describe('request.agent(app)', function(){
  var app = express();

  app.use(express.cookieParser());

  app.get('/', function(req, res){
    res.cookie('cookie', 'hey');
    res.send();
  });

  app.get('/return', function(req, res){
    if(req.cookies.cookie) res.send(req.cookies.cookie);
    else res.send(':(')
  });

  var agent = request.agent(app);

  it('should save cookies', function(done){
    agent
    .get('/')
    .expect('set-cookie', 'cookie=hey; Path=/', done);
  })

  it('should send cookies', function(done){
    agent
    .get('/return')
    .expect('hey', done);
  })
})

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
steff-mueller added 3 commits March 14, 2013 17:48
@steff-mueller
Updated express dependency
c101286
@steff-mueller
Added request.agent(app) support
da69243
@steff-mueller
Expose Test to enable extensibility
0956c37
@steff-mueller

steff-mueller commented Mar 20, 2013

Copy link
Copy Markdown
Contributor Author

I added another commit which exposes Test to enable easier extensibility (ie custom expectations, ...).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yields

yields commented Apr 15, 2013

Copy link
Copy Markdown

+1

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tj added a commit that referenced this pull request Apr 15, 2013
@tj
Merge pull request #54 from Arxisos/master
c6d2fad
Added request.agent(app) support
@tj
tj merged commit c6d2fad into forwardemail:master Apr 15, 2013
@gabegorelick gabegorelick mentioned this pull request Mar 20, 2020
Expose superagent to perform it's configuration #202
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@steff-mueller @yields @tj
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.