Skip to content

Commit d8cca1a

Browse files
committed
fix lint
1 parent ddcb592 commit d8cca1a

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

test/e2e/tests/solana/mocks/websocketDefaultMocks.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Configuration for a WebSocket message mock
33
*/
4-
export interface WebSocketMessageMock {
4+
export type WebSocketMessageMock = {
55
/** String(s) that the message should include to trigger this mock */
66
messageIncludes: string | string[];
77
/** The JSON response to send back */
@@ -10,7 +10,7 @@ export interface WebSocketMessageMock {
1010
delay?: number;
1111
/** Custom log message for this mock */
1212
logMessage?: string;
13-
}
13+
};
1414

1515
export const DEFAULT_SOLANA_WS_MOCKS: WebSocketMessageMock[] = [
1616
{
@@ -27,27 +27,36 @@ export const DEFAULT_SOLANA_WS_MOCKS: WebSocketMessageMock[] = [
2727
messageIncludes: 'accountSubscribe',
2828
response: {
2929
jsonrpc: '2.0',
30-
result: 'b07ebf7caf2238a9b604d4dfcaf1934280fcd347d6eded62bc0def6cbb767d11',
30+
result:
31+
'b07ebf7caf2238a9b604d4dfcaf1934280fcd347d6eded62bc0def6cbb767d11',
3132
id: '1',
3233
},
3334
delay: 500,
3435
logMessage: 'Account subscribe message received from client',
3536
},
3637
{
37-
messageIncludes: ['programSubscribe', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'],
38+
messageIncludes: [
39+
'programSubscribe',
40+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
41+
],
3842
response: {
3943
jsonrpc: '2.0',
40-
result: '568eafd45635c108d0d426361143de125a841628a58679f5a024cbab9a20b41c',
44+
result:
45+
'568eafd45635c108d0d426361143de125a841628a58679f5a024cbab9a20b41c',
4146
id: '1',
4247
},
4348
delay: 500,
4449
logMessage: 'Program subscribe message received from client',
4550
},
4651
{
47-
messageIncludes: ['programSubscribe', 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'],
52+
messageIncludes: [
53+
'programSubscribe',
54+
'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
55+
],
4856
response: {
4957
jsonrpc: '2.0',
50-
result: 'f33dd9975158af47bf16c7f6062a73191d4595c59cfec605d5a51e25c65ffb51',
58+
result:
59+
'f33dd9975158af47bf16c7f6062a73191d4595c59cfec605d5a51e25c65ffb51',
5160
id: '1',
5261
},
5362
delay: 500,

test/e2e/websocket-solana-mocks.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { WebSocketMessageMock } from './tests/solana/mocks/websocketDefaultMocks
55

66
/**
77
* Sets up Solana WebSocket mocks with configurable message handlers
8-
* @param mocks Array of message mock configurations
8+
*
9+
* @param mocks - Array of message mock configurations
910
*/
1011
export async function setupSolanaWebsocketMocks(
1112
mocks: WebSocketMessageMock[] = [],
@@ -29,7 +30,9 @@ export async function setupSolanaWebsocketMocks(
2930
: [mock.messageIncludes];
3031

3132
// Check if all required strings are included in the message
32-
const matches = includes.every((includeStr) => message.includes(includeStr));
33+
const matches = includes.every((includeStr) =>
34+
message.includes(includeStr),
35+
);
3336

3437
if (matches) {
3538
if (mock.logMessage) {
@@ -39,7 +42,9 @@ export async function setupSolanaWebsocketMocks(
3942
const delay = mock.delay || 500;
4043
setTimeout(() => {
4144
socket.send(JSON.stringify(mock.response));
42-
console.log(`Simulated message sent to the client for: ${includes.join(' + ')}`);
45+
console.log(
46+
`Simulated message sent to the client for: ${includes.join(' + ')}`,
47+
);
4348
}, delay);
4449

4550
// Break after first match to avoid multiple responses

0 commit comments

Comments
 (0)