fix msg abbreviation

This commit is contained in:
Fred K. Schott
2019-12-16 17:25:21 -08:00
parent 312f831efb
commit cf544b74f5
2 changed files with 5 additions and 5 deletions

View File

@@ -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()

View File

@@ -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);