1
1
import { expect } from 'chai' ;
2
2
import * as sinon from 'sinon' ;
3
3
import * as winston from 'winston' ;
4
- import ApiTransport , { type ApiTransportOptions } from '../../../src/lib/api-transport.js' ;
4
+ import ApiLogsTransport , { type ApiTransportOptions } from '../../../src/lib/api-logs -transport.js' ;
5
5
import { Socket } from 'socket.io-client' ;
6
6
import { useSandboxWithFakeTimers } from '../../utils.js' ;
7
7
8
- describe ( 'ApiTransport ' , ( ) => {
8
+ describe ( 'ApiLogsTransport ' , ( ) => {
9
9
let sandbox : sinon . SinonSandbox ;
10
10
let socket : sinon . SinonStubbedInstance < Socket > ;
11
11
const ACK_DELAY = 50 ;
@@ -19,7 +19,7 @@ describe('ApiTransport', () => {
19
19
} ;
20
20
21
21
const createTransportAndLogger = ( options : ApiTransportOptions ) => {
22
- const transport = new ApiTransport ( { ...options , socket } ) ;
22
+ const transport = new ApiLogsTransport ( { ...options , socket } ) ;
23
23
const logger = winston . createLogger ( { transports : [ transport ] } ) ;
24
24
25
25
return { transport, logger } ;
@@ -38,7 +38,7 @@ describe('ApiTransport', () => {
38
38
39
39
describe ( 'constructor' , ( ) => {
40
40
it ( 'should set default options if none are provided' , ( ) => {
41
- const transport = new ApiTransport ( ) ;
41
+ const transport = new ApiLogsTransport ( ) ;
42
42
const { sendingEnabled, bufferSize, sendInterval } = transport . getCurrentSettings ( ) ;
43
43
44
44
expect ( sendingEnabled ) . to . be . false ;
@@ -52,7 +52,7 @@ describe('ApiTransport', () => {
52
52
bufferSize : 50 ,
53
53
sendInterval : 5000 ,
54
54
} ;
55
- const transport = new ApiTransport ( options ) ;
55
+ const transport = new ApiLogsTransport ( options ) ;
56
56
const { sendingEnabled, bufferSize, sendInterval } = transport . getCurrentSettings ( ) ;
57
57
58
58
expect ( sendingEnabled ) . to . be . true ;
@@ -286,7 +286,7 @@ describe('ApiTransport', () => {
286
286
} ) ;
287
287
288
288
it ( 'should only update provided settings' , ( ) => {
289
- const transport = new ApiTransport ( { sendingEnabled : false , maxBufferSize : 100 , sendInterval : 10000 } ) ;
289
+ const transport = new ApiLogsTransport ( { sendingEnabled : false , maxBufferSize : 100 , sendInterval : 10000 } ) ;
290
290
291
291
transport . updateSettings ( { sendingEnabled : true } ) ;
292
292
const { sendingEnabled, bufferSize, sendInterval } = transport . getCurrentSettings ( ) ;
0 commit comments