test-query-after-destroy.js 394 B

123456789101112131415161718
  1. var common = require('../../common');
  2. var connection = common.createConnection();
  3. var assert = require('assert');
  4. var err;
  5. connection.connect(function() {
  6. connection.destroy();
  7. connection.query('SELECT 1', function(_err) {
  8. err = _err;
  9. });
  10. });
  11. process.on('exit', function() {
  12. assert.equal(err.fatal, false);
  13. assert.equal(err.code, 'PROTOCOL_ENQUEUE_AFTER_DESTROY');
  14. });