@@ -82,6 +82,13 @@ describe("protocol tests", () => {
82
82
} ) ;
83
83
84
84
describe ( "_meta preservation with onprogress" , ( ) => {
85
+ beforeEach ( ( ) => {
86
+ jest . useFakeTimers ( ) ;
87
+ } ) ;
88
+ afterEach ( ( ) => {
89
+ jest . useRealTimers ( ) ;
90
+ } ) ;
91
+
85
92
test ( "should preserve existing _meta when adding progressToken" , async ( ) => {
86
93
await protocol . connect ( transport ) ;
87
94
const request = {
@@ -101,6 +108,8 @@ describe("protocol tests", () => {
101
108
102
109
protocol . request ( request , mockSchema , {
103
110
onprogress : onProgressMock ,
111
+ resetTimeoutOnProgress : false ,
112
+
104
113
} ) ;
105
114
106
115
expect ( sendSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( {
@@ -133,6 +142,8 @@ describe("protocol tests", () => {
133
142
134
143
protocol . request ( request , mockSchema , {
135
144
onprogress : onProgressMock ,
145
+ resetTimeoutOnProgress : false ,
146
+
136
147
} ) ;
137
148
138
149
expect ( sendSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( {
@@ -163,7 +174,10 @@ describe("protocol tests", () => {
163
174
result : z . string ( ) ,
164
175
} ) ;
165
176
166
- protocol . request ( request , mockSchema ) ;
177
+ protocol . request ( request , mockSchema , {
178
+ resetTimeoutOnProgress : false ,
179
+
180
+ } ) ;
167
181
168
182
expect ( sendSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( {
169
183
method : "example" ,
@@ -190,6 +204,8 @@ describe("protocol tests", () => {
190
204
191
205
protocol . request ( request , mockSchema , {
192
206
onprogress : onProgressMock ,
207
+ resetTimeoutOnProgress : false ,
208
+
193
209
} ) ;
194
210
195
211
expect ( sendSpy ) . toHaveBeenCalledWith ( expect . objectContaining ( {
0 commit comments