mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-08-05 12:40:39 +08:00
Initial work on the server
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
var common = require('../../common');
|
||||
var connection = common.createConnection();
|
||||
var assert = require('assert');
|
||||
|
||||
connection.connect();
|
||||
|
||||
var gotEnd = false;
|
||||
connection.on('end', function(err) {
|
||||
assert.equal(gotEnd, false);
|
||||
assert.ok(!err);
|
||||
|
||||
gotEnd = true;
|
||||
});
|
||||
|
||||
var gotCallback = false;
|
||||
connection.end(function(err) {
|
||||
if (err) throw err;
|
||||
|
||||
assert.equal(gotCallback, false);
|
||||
gotCallback = true;
|
||||
});
|
||||
|
||||
process.on('exit', function() {
|
||||
assert.equal(gotCallback, true);
|
||||
assert.equal(gotEnd, true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user