Passing a url #33

Closed
Philmod opened this Issue Oct 31, 2012 · 3 comments

Comments

Projects
None yet
3 participants

Philmod commented Oct 31, 2012

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 commented Nov 21, 2012

Any advice please?

@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 closed this in 2c66d31 Dec 28, 2012

Owner

tj commented Dec 28, 2012

sorry about that, bad docs, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment