File tree Expand file tree Collapse file tree 1 file changed +0
-38
lines changed Expand file tree Collapse file tree 1 file changed +0
-38
lines changed Original file line number Diff line number Diff line change @@ -100,41 +100,3 @@ test("should read multiple messages", async () => {
100
100
await finished ;
101
101
expect ( readMessages ) . toEqual ( messages ) ;
102
102
} ) ;
103
-
104
- test ( "should properly clean up resources when closed" , async ( ) => {
105
- // Create mock streams that track their destroyed state
106
- const mockStdin = new Readable ( {
107
- read ( ) { } , // No-op implementation
108
- destroy ( ) {
109
- this . destroyed = true ;
110
- return this ;
111
- }
112
- } ) ;
113
- const mockStdout = new Writable ( {
114
- write ( chunk , encoding , callback ) {
115
- callback ( ) ;
116
- } ,
117
- destroy ( ) {
118
- this . destroyed = true ;
119
- return this ;
120
- }
121
- } ) ;
122
-
123
- const transport = new StdioServerTransport ( mockStdin , mockStdout ) ;
124
- await transport . start ( ) ;
125
-
126
- // Send a message to potentially create listeners
127
- await transport . send ( { jsonrpc : "2.0" , method : "test" , id : 1 } ) ;
128
-
129
- // Close the transport
130
- await transport . close ( ) ;
131
-
132
- // Check that all listeners were removed
133
- expect ( mockStdin . listenerCount ( 'data' ) ) . toBe ( 0 ) ;
134
- expect ( mockStdin . listenerCount ( 'error' ) ) . toBe ( 0 ) ;
135
- expect ( mockStdout . listenerCount ( 'drain' ) ) . toBe ( 0 ) ;
136
-
137
- // Check that streams were properly ended
138
- expect ( mockStdin . destroyed ) . toBe ( true ) ;
139
- expect ( mockStdout . destroyed ) . toBe ( true ) ;
140
- } ) ;
You can’t perform that action at this time.
0 commit comments