Skip to content

Commit

Permalink
Test case for #304.
Browse files Browse the repository at this point in the history
  • Loading branch information
diversario committed Sep 11, 2013
1 parent 21a6357 commit abcbadd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var server = require('./server')

var s = server.createServer();
var expectedBody = "waited";
var remainingTests = 5;
var remainingTests = 6;

s.listen(s.port, function () {
// Request that waits for 200ms
Expand All @@ -32,6 +32,17 @@ s.listen(s.port, function () {
})


var shouldTimeoutWithEvents = {
url: s.url + "/timeout",
timeout:100
}

request(shouldTimeoutWithEvents)
.on('error', function (err) {
assert.equal(err.code, "ETIMEDOUT");
checkDone();
})

// Scenario that shouldn't timeout
var shouldntTimeout = {
url: s.url + "/timeout",
Expand Down

0 comments on commit abcbadd

Please sign in to comment.