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.

24 lines
787 B

12 years ago
  1. // This test verifies that changeUser errors are treated as fatal errors. The
  2. // rationale for that is that a failure to execute a changeUser sequence may
  3. // cause unexpected behavior for queries that were enqueued under the
  4. // assumption of changeUser to succeed.
  5. var common = require('../../common');
  6. var connection = common.createConnection();
  7. var assert = require('assert');
  8. if (common.isTravis()) {
  9. return console.log('skipping - travis mysql does not support this test');
  10. }
  11. var err;
  12. connection.changeUser({user: 'does-not-exist'}, function(_err) {
  13. err = _err;
  14. connection.end();
  15. });
  16. process.on('exit', function() {
  17. if (process.env.NO_GRANT == '1' && err === null) return;
  18. assert.equal(err.code, 'ER_ACCESS_DENIED_ERROR');
  19. assert.equal(err.fatal, true);
  20. });