mirror of https://github.com/lukechilds/got.git
Vsevolod Strukchinsky
10 years ago
3 changed files with 33 additions and 2 deletions
@ -0,0 +1,29 @@ |
|||
'use strict'; |
|||
var tape = require('tape'); |
|||
var got = require('../'); |
|||
var server = require('./server.js'); |
|||
var s = server.createServer(); |
|||
|
|||
s.on('/', function (req, res) { |
|||
res.statusCode = 404; |
|||
res.end('not'); |
|||
}); |
|||
|
|||
tape('setup', function (t) { |
|||
s.listen(s.port, function () { |
|||
t.end(); |
|||
}); |
|||
}); |
|||
|
|||
tape('error message', function (t) { |
|||
got(s.url, function (err) { |
|||
t.ok(err); |
|||
t.equal(err.message, 'http://localhost:6767 response code is 404 (Not Found)'); |
|||
t.end(); |
|||
}); |
|||
}); |
|||
|
|||
tape('cleanup', function (t) { |
|||
s.close(); |
|||
t.end(); |
|||
}); |
Loading…
Reference in new issue