Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Passing a url #33

Closed
Philmod opened this Issue · 3 comments

3 participants

@Philmod

Hi!

When I want to pass a url instead of a server, I do:

var request = require('supertest')
  , request = request.bind(request, 'http://localhost:3000')
  ;

In the tests:

request
  .post('/smth...')
  .expect(200)
  .end(function(err,res) {...});

But I get the error:

TypeError: Object function() { [native code] } has no method 'post'

Can you please tell me what I'm doing bad?

Best,
Philmod

node v0.8.12
supertest v0.4.0

@Philmod

Any advice please?

@shanestillwell

@Philmod Following the example in the README didn't work for me either, just pass a string as the the app, like in this test case.

https://github.com/visionmedia/supertest/blob/master/test/supertest.js#L43

@tj tj closed this in 2c66d31
@tj
Owner
tj commented

sorry about that, bad docs, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.