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.

25 lines
632 B

12 years ago
  1. var common = require('../../common');
  2. var connection = common.createConnection({password: common.bogusPassword});
  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. connection.end();
  13. });
  14. process.on('exit', function() {
  15. if (process.env.NO_GRANT == '1' && errors.a === null) return;
  16. assert.equal(errors.a.code, 'ER_ACCESS_DENIED_ERROR');
  17. assert.equal(errors.a.fatal, true);
  18. assert.strictEqual(errors.a, errors.b);
  19. });