File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import fs from 'node:fs' ;
2
2
import axios , { type InternalAxiosRequestConfig } from 'axios' ;
3
3
import { assert , expect } from 'chai' ;
4
- import nock from 'nock' ;
4
+ import nock , { type ReplyHeaders } from 'nock' ;
5
5
import sinon from 'sinon' ;
6
6
import {
7
7
type RequestConfig ,
@@ -1102,14 +1102,15 @@ describe('WebClient', () => {
1102
1102
} ) ;
1103
1103
1104
1104
it ( 'should throw an error if the response has no retry info' , async ( ) => {
1105
- // @ts -expect-error header values cannot be undefined
1106
- const scope = nock ( 'https://slack.com' ) . post ( / a p i / ) . reply ( 429 , { } , { 'retry-after' : undefined } ) ;
1105
+ const emptyHeaders : ReplyHeaders = { } ;
1106
+ const scope = nock ( 'https://slack.com' ) . post ( / a p i / ) . reply ( 429 , { } , emptyHeaders ) ;
1107
1107
const client = new WebClient ( token ) ;
1108
1108
try {
1109
1109
await client . apiCall ( 'method' ) ;
1110
1110
assert . fail ( 'expected error to be thrown' ) ;
1111
1111
} catch ( err ) {
1112
1112
assert . instanceOf ( err , Error ) ;
1113
+ } finally {
1113
1114
scope . done ( ) ;
1114
1115
}
1115
1116
} ) ;
You can’t perform that action at this time.
0 commit comments