Skip to content

Commit 976ff74

Browse files
committed
Replace type casting with direct sessionId property access in SSE tests
1 parent 84447c2 commit 976ff74

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/server/sse.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('SSEServerTransport', () => {
2020
const mockRes = createMockResponse();
2121
const endpoint = '/messages';
2222
const transport = new SSEServerTransport(endpoint, mockRes);
23-
const expectedSessionId = (transport as any)._sessionId;
23+
const expectedSessionId = transport.sessionId;
2424

2525
await transport.start();
2626

@@ -35,7 +35,7 @@ describe('SSEServerTransport', () => {
3535
const mockRes = createMockResponse();
3636
const endpoint = '/messages?foo=bar&baz=qux';
3737
const transport = new SSEServerTransport(endpoint, mockRes);
38-
const expectedSessionId = (transport as any)._sessionId;
38+
const expectedSessionId = transport.sessionId;
3939

4040
await transport.start();
4141

@@ -50,7 +50,7 @@ describe('SSEServerTransport', () => {
5050
const mockRes = createMockResponse();
5151
const endpoint = '/messages#section1';
5252
const transport = new SSEServerTransport(endpoint, mockRes);
53-
const expectedSessionId = (transport as any)._sessionId;
53+
const expectedSessionId = transport.sessionId;
5454

5555
await transport.start();
5656

@@ -65,7 +65,7 @@ describe('SSEServerTransport', () => {
6565
const mockRes = createMockResponse();
6666
const endpoint = '/messages?key=value#section2';
6767
const transport = new SSEServerTransport(endpoint, mockRes);
68-
const expectedSessionId = (transport as any)._sessionId;
68+
const expectedSessionId = transport.sessionId;
6969

7070
await transport.start();
7171

@@ -80,7 +80,7 @@ describe('SSEServerTransport', () => {
8080
const mockRes = createMockResponse();
8181
const endpoint = '/';
8282
const transport = new SSEServerTransport(endpoint, mockRes);
83-
const expectedSessionId = (transport as any)._sessionId;
83+
const expectedSessionId = transport.sessionId;
8484

8585
await transport.start();
8686

@@ -95,7 +95,7 @@ describe('SSEServerTransport', () => {
9595
const mockRes = createMockResponse();
9696
const endpoint = '';
9797
const transport = new SSEServerTransport(endpoint, mockRes);
98-
const expectedSessionId = (transport as any)._sessionId;
98+
const expectedSessionId = transport.sessionId;
9999

100100
await transport.start();
101101

0 commit comments

Comments
 (0)