TwitchBot/node_modules/mysql/test/integration/connection/test-callback-errors-are-not-caught.js
Steve Saldivar ec2e35c117 commit
2013-05-07 14:03:51 -07:00

21 lines
398 B
JavaScript

var common = require('../../common');
var connection = common.createConnection();
var assert = require('assert');
var err = new Error('uncaught exception');
connection.connect(function() {
throw err;
});
var caughtErr;
process.on('uncaughtException', function(err) {
caughtErr = err;
process.exit(0);
});
process.on('exit', function() {
assert.strictEqual(caughtErr, err);
});