supertest
supertest copied to clipboard
Passing a url
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
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
sorry about that, bad docs, fixed