Skip to content

Commit 1cb0ea1

Browse files
dependabot[bot]mwbrooksWilliamBergamin
authored
chore(deps-dev): bump nock from 13.5.6 to 14.0.3 in /packages/web-api (#2223)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Brooks <mbrooks@slack-corp.com> Co-authored-by: William Bergamin <wbergamin@slack-corp.com>
1 parent 86acb79 commit 1cb0ea1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/web-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"mocha": "^11",
6262
"mocha-junit-reporter": "^2.2.1",
6363
"mocha-multi-reporters": "^1.5.1",
64-
"nock": "^13",
64+
"nock": "^14",
6565
"shx": "^0.4.0",
6666
"sinon": "^20",
6767
"source-map-support": "^0.5.21",

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

Lines changed: 5 additions & 4 deletions
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,
@@ -801,7 +801,7 @@ describe('WebClient', () => {
801801

802802
describe('has an option to set request concurrency', () => {
803803
// TODO: factor out common logic into test helpers
804-
const responseDelay = 100; // ms
804+
const responseDelay = 500; // ms
805805
let testStart: number;
806806
let scope: nock.Scope;
807807

@@ -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 & { 'retry-after'?: never } = {}; // Ensure that 'retry-after' is not in the headers
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)