mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
fix msg abbreviation
This commit is contained in:
@@ -8,7 +8,7 @@ import {RippledError, DisconnectedError, NotConnectedError,
|
|||||||
RippledNotInitializedError} from './errors'
|
RippledNotInitializedError} from './errors'
|
||||||
|
|
||||||
export interface ConnectionOptions {
|
export interface ConnectionOptions {
|
||||||
trace?: boolean | ((id: string, msg: string) => void)
|
trace?: boolean | ((id: string, message: string) => void)
|
||||||
proxy?: string
|
proxy?: string
|
||||||
proxyAuthorization?: string
|
proxyAuthorization?: string
|
||||||
authorization?: string
|
authorization?: string
|
||||||
@@ -46,7 +46,7 @@ class Connection extends EventEmitter {
|
|||||||
private _fee_ref: null|number = null
|
private _fee_ref: null|number = null
|
||||||
private _connectionTimeout: number
|
private _connectionTimeout: number
|
||||||
|
|
||||||
private _trace: (id: string, msg: string) => void = () => {}
|
private _trace: (id: string, message: string) => void = () => {}
|
||||||
|
|
||||||
constructor(url, options: ConnectionOptions = {}) {
|
constructor(url, options: ConnectionOptions = {}) {
|
||||||
super()
|
super()
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ describe('Connection', function() {
|
|||||||
|
|
||||||
it('as false', function() {
|
it('as false', function() {
|
||||||
const messages = [];
|
const messages = [];
|
||||||
console.log = (id, msg) => messages.push([id, msg]);
|
console.log = (id, message) => messages.push([id, message]);
|
||||||
const connection: any = new utils.common.Connection('url', {trace: false});
|
const connection: any = new utils.common.Connection('url', {trace: false});
|
||||||
connection._ws = {send: function() {}};
|
connection._ws = {send: function() {}};
|
||||||
connection._send(message1);
|
connection._send(message1);
|
||||||
@@ -57,7 +57,7 @@ describe('Connection', function() {
|
|||||||
|
|
||||||
it('as true', function() {
|
it('as true', function() {
|
||||||
const messages = [];
|
const messages = [];
|
||||||
console.log = (id, msg) => messages.push([id, msg]);
|
console.log = (id, message) => messages.push([id, message]);
|
||||||
const connection: any = new utils.common.Connection('url', {trace: true});
|
const connection: any = new utils.common.Connection('url', {trace: true});
|
||||||
connection._ws = {send: function() {}};
|
connection._ws = {send: function() {}};
|
||||||
connection._send(message1);
|
connection._send(message1);
|
||||||
@@ -68,7 +68,7 @@ describe('Connection', function() {
|
|||||||
it('as a function', function() {
|
it('as a function', function() {
|
||||||
const messages = [];
|
const messages = [];
|
||||||
const connection: any = new utils.common.Connection('url', {
|
const connection: any = new utils.common.Connection('url', {
|
||||||
trace: (id, msg) => messages.push([id, msg])
|
trace: (id, message) => messages.push([id, message])
|
||||||
});
|
});
|
||||||
connection._ws = {send: function() {}};
|
connection._ws = {send: function() {}};
|
||||||
connection._send(message1);
|
connection._send(message1);
|
||||||
|
|||||||
Reference in New Issue
Block a user