This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
node-task/node_modules/mysql2/test/integration/connection/test-handshake-errors.js

25 lines
460 B
JavaScript
Raw Normal View History

2014-09-24 17:56:53 -04:00
var common = require('../../common');
var assert = require('assert');
var conns = [];
function spawn() {
var c = common.createConnection();
c.ping(spawn);
conns.push(c);
c.on('error', function(err) {
conns.forEach(function(c) { if (c) c.end(); })
});
}
spawn();
process.on('uncaughtException', function(e) {
assert(false, 'should not have uncaught exceptions');
});
process.on('exit', function() {
assert(conns.length > 0);
});