8000 test: fix password encoding test when using WHATWG URL · mysqljs/mysql@2e2a156 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e2a156

Browse files
committed
test: fix password encoding test when using WHATWG URL
1 parent e909c09 commit 2e2a156

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/unit/test-ConnectionConfig.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var Crypto = require('crypto');
33
var test = require('utest');
44
var assert = require('assert' 8C52 ;);
55
var ConnectionConfig = common.ConnectionConfig;
6+
var usesWhatwgUrl = (typeof URL == 'function' && typeof URL.prototype == 'object');
67

78
test('ConnectionConfig#Constructor', {
89
'takes user,pw,host,port,db from url string': function() {
@@ -23,7 +24,7 @@ test('ConnectionConfig#Constructor', {
2324
assert.equal(config.host, 'myhost');
2425
assert.equal(config.port, 3333);
2526
assert.equal(config.user, 'myuser');
26-
assert.equal(config.password, 'my:pass');
27+
assert.equal(config.password, usesWhatwgUrl ? 'my%3Apass' : 'my:pass');
2728
assert.equal(config.database, 'mydb');
2829
},
2930

0 commit comments

Comments
 (0)
0