mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-30 17:15:49 +00:00
Allow to specify server url without explicit port number
This commit is contained in:
@@ -818,4 +818,9 @@ describe('RippleAPI - offline', function() {
|
||||
assert(!api.isValidAddress(hex));
|
||||
});
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
it('RippleAPI - implicit server port', function() {
|
||||
const api = new RippleAPI({servers: ['wss://s1.ripple.com']});
|
||||
});
|
||||
/* eslint-enable no-unused-vars */
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ describe('Remote', function() {
|
||||
assert.throws(
|
||||
function() {
|
||||
new Remote({
|
||||
servers: [{host: 's-west.ripple.com', port: null, secure: true}]
|
||||
servers: [{host: 's-west.ripple.com', port: 'null', secure: true}]
|
||||
});
|
||||
}, TypeError);
|
||||
});
|
||||
@@ -148,21 +148,26 @@ describe('Remote', function() {
|
||||
);
|
||||
});
|
||||
|
||||
/*
|
||||
"url" module used in server parses such urls with error, it return
|
||||
null for port, so in this case default port will be used
|
||||
|
||||
it('Server initialization -- url string -- invalid port', function() {
|
||||
assert.throws(
|
||||
function() {
|
||||
new Remote({
|
||||
servers: ['ws://s-west.ripple.com:null']
|
||||
servers: ['ws://s-west.ripple.com:invalid']
|
||||
});
|
||||
}, Error
|
||||
);
|
||||
});
|
||||
*/
|
||||
|
||||
it('Server initialization -- url string -- port out of range', function() {
|
||||
assert.throws(
|
||||
function() {
|
||||
new Remote({
|
||||
servers: ['ws://s-west.ripple.com:65537:']
|
||||
servers: ['ws://s-west.ripple.com:65537']
|
||||
});
|
||||
}, Error
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user