summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/tests/test-toJSON.js
blob: b7c67effcaf8e4dffbe616e513308665a150b114 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var request = require('../main')
  , http = require('http')
  , assert = require('assert')
  ;

var s = http.createServer(function (req, resp) {
  resp.statusCode = 200
  resp.end('asdf')
}).listen(8080, function () {
  var r = request('http://localhost:8080', function (e, resp) {
    assert.equal(JSON.parse(JSON.stringify(r)).response.statusCode, 200)
    s.close()
  })
})