A Twitch.tv viewer reward and games system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
528 B

12 years ago
  1. var common = require('../../common');
  2. var connection = common.createConnection({port: common.bogusPort});
  3. var assert = require('assert');
  4. var errors = {};
  5. connection.connect(function(err) {
  6. assert.equal(errors.a, undefined);
  7. errors.a = err;
  8. });
  9. connection.query('SELECT 1', function(err) {
  10. assert.equal(errors.b, undefined);
  11. errors.b = err;
  12. });
  13. process.on('exit', function() {
  14. assert.equal(errors.a.code, 'ECONNREFUSED');
  15. assert.equal(errors.a.fatal, true);
  16. assert.strictEqual(errors.a, errors.b);
  17. });