Skip to content

Commit 7aa6da6

Browse files
committed
tests: updates change user test to cover calling without specifing new user
1 parent c97737a commit 7aa6da6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/unit/connection/test-change-user.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,18 @@ server.listen(common.fakeServerPort, function(err) {
2121
assert.ifError(err);
2222
assert.strictEqual(result[0]['CURRENT_USER()'], 'user_2@localhost');
2323

24-
connection.destroy();
25-
server.destroy();
24+
// should keep current user
25+
connection.changeUser(function (err) {
26+
assert.ifError(err);
27+
28+
connection.query('SELECT CURRENT_USER()', function (err, result) {
29+
assert.ifError(err);
30+
assert.strictEqual(result[0]['CURRENT_USER()'], 'user_2@localhost');
31+
32+
connection.destroy();
33+
server.destroy();
34+
});
35+
});
2636
});
2737
});
2838
});

0 commit comments

Comments
 (0)