Skip to content

Commit

Permalink
test: fix password encoding test when using WHATWG URL
Browse files Browse the repository at this point in the history
  • Loading branch information
dresende committed Nov 21, 2023
1 parent e909c09 commit 2e2a156
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit/test-ConnectionConfig.js
Expand Up @@ -3,6 +3,7 @@ var Crypto = require('crypto');
var test = require('utest');
var assert = require('assert');
var ConnectionConfig = common.ConnectionConfig;
var usesWhatwgUrl = (typeof URL == 'function' && typeof URL.prototype == 'object');

test('ConnectionConfig#Constructor', {
'takes user,pw,host,port,db from url string': function() {
Expand All @@ -23,7 +24,7 @@ test('ConnectionConfig#Constructor', {
assert.equal(config.host, 'myhost');
assert.equal(config.port, 3333);
assert.equal(config.user, 'myuser');
assert.equal(config.password, 'my:pass');
assert.equal(config.password, usesWhatwgUrl ? 'my%3Apass' : 'my:pass');
assert.equal(config.database, 'mydb');
},

Expand Down

0 comments on commit 2e2a156

Please sign in to comment.