Skip to content

Commit c122f5b

Browse files
Fix disallowed undefined header in test
1 parent 6957415 commit c122f5b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/web-api/src/WebClient.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'node:fs';
22
import axios, { type InternalAxiosRequestConfig } from 'axios';
33
import { assert, expect } from 'chai';
4-
import nock from 'nock';
4+
import nock, { type ReplyHeaders } from 'nock';
55
import sinon from 'sinon';
66
import {
77
type RequestConfig,
@@ -1102,14 +1102,15 @@ describe('WebClient', () => {
11021102
});
11031103

11041104
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(/api/).reply(429, {}, { 'retry-after': undefined });
1105+
const emptyHeaders: ReplyHeaders = {};
1106+
const scope = nock('https://slack.com').post(/api/).reply(429, {}, emptyHeaders);
11071107
const client = new WebClient(token);
11081108
try {
11091109
await client.apiCall('method');
11101110
assert.fail('expected error to be thrown');
11111111
} catch (err) {
11121112
assert.instanceOf(err, Error);
1113+
} finally {
11131114
scope.done();
11141115
}
11151116
});

0 commit comments

Comments
 (0)