mirror of
https://github.com/sstent/node.git
synced 2026-01-27 07:33:13 +00:00
28 lines
493 B
JavaScript
28 lines
493 B
JavaScript
var common = require('../../../common');
|
|
var assert = require('assert');
|
|
|
|
var client = common.createClient();
|
|
var callbacks = [];
|
|
client.query('SELECT 1', function(err, results) {
|
|
if (err) throw err;
|
|
|
|
callbacks.push(1);
|
|
});
|
|
|
|
client.end(function(err) {
|
|
if (err) throw err;
|
|
|
|
callbacks.push(2);
|
|
});
|
|
|
|
client.query('SELECT 1', function(err) {
|
|
if (err) throw err;
|
|
|
|
callbacks.push(3);
|
|
client.destroy();
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert.deepEqual(callbacks, [1, 2, 3]);
|
|
});
|