mazda-specs-crepe/node_modules/request/tests/test-toJSON.js
2013-02-19 18:02:59 +11:00

14 lines
No EOL
376 B
JavaScript

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()
})
})