Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
test: ensure callback is executed
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Dec 22, 2011
1 parent 5976d58 commit b261e37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/simple/test-net-write-after-close.js
Expand Up @@ -23,6 +23,11 @@ var common = require('../common');
var assert = require('assert');
var net = require('net');

var gotError = false;

process.on('exit', function() {
assert(gotError);
});

var server = net.createServer(function(socket) {
setTimeout(function() {
Expand All @@ -32,7 +37,8 @@ var server = net.createServer(function(socket) {
},
/This socket is closed/
);
process.exit();
server.close();
gotError = true;
}, 250);
});

Expand Down

0 comments on commit b261e37

Please sign in to comment.