File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,16 @@ Deno.test('fetch', async (t) => {
132
132
assert ( ( res . unwrapErr ( ) as Error ) . message . includes ( `Response is invalid json` ) ) ;
133
133
} ) ;
134
134
135
+ await t . step ( 'Ignore timeout when success' , async ( ) => {
136
+ const res = await fetchT ( mockSingle , {
137
+ timeout : 10000 ,
138
+ } ) ;
139
+
140
+ assert ( res . isOk ( ) ) ;
141
+ // Leak risk
142
+ res . unwrap ( ) . body ?. cancel ( ) ;
143
+ } ) ;
144
+
135
145
await t . step ( 'Abort fetch by default' , async ( ) => {
136
146
const fetchTask = fetchT ( mockSingle , {
137
147
abortable : true ,
@@ -140,7 +150,7 @@ Deno.test('fetch', async (t) => {
140
150
141
151
setTimeout ( ( ) => {
142
152
fetchTask . abort ( ) ;
143
- } , 0 ) ;
153
+ } , 100 ) ;
144
154
145
155
const res = await fetchTask . response ;
146
156
assert ( ( res . unwrapErr ( ) as Error ) . name === ABORT_ERROR ) ;
You can’t perform that action at this time.
0 commit comments