var common     = require('../common');
var connection = common.createConnection({password: 'INVALID PASSWORD'});
var assert     = require('assert');

var err;
connection.connect(function(_err) {
  assert.equal(err, undefined);
  err = _err;
});

process.on('exit', function() {
  assert.ok(/access denied/i.test(err.message));
  assert.equal(err.code, 'ER_ACCESS_DENIED_ERROR');
});


@@ -284,97 +284,97 @@
 ert.
-ok(/access denied/i.test(err.message));%0A  assert.equal(err.code, 'ER_ACCESS_DENIED_ERROR'
+equal(err.code, 'ER_ACCESS_DENIED_ERROR');%0A  assert.ok(/access denied/i.test(err.message)
 );%0A%7D

Make test error more useful