Skip to content

Commit 3da16e0

Browse files
committed
Upgrade dependencies
1 parent 731e4fa commit 3da16e0

9 files changed

+21
-28
lines changed

package.json

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,13 @@
6767
"@types/request": "^2.48.4",
6868
"@types/sinon": "^9.0.0",
6969
"@types/tough-cookie": "^4.0.0",
70-
"@typescript-eslint/eslint-plugin": "^2.27.0",
71-
"@typescript-eslint/parser": "^2.27.0",
7270
"ava": "^3.6.0",
7371
"axios": "^0.19.2",
7472
"benchmark": "^2.1.4",
7573
"coveralls": "^3.0.4",
7674
"create-test-server": "^3.0.1",
7775
"del-cli": "^3.0.0",
7876
"delay": "^4.3.0",
79-
"eslint-config-xo-typescript": "^0.27.0",
8077
"express": "^4.17.1",
8178
"form-data": "^3.0.0",
8279
"lolex": "^6.0.0",
@@ -90,8 +87,8 @@
9087
"tempy": "^0.5.0",
9188
"to-readable-stream": "^2.1.0",
9289
"tough-cookie": "^4.0.0",
93-
"typescript": "3.7.5",
94-
"xo": "^0.29.0"
90+
"typescript": "3.8.3",
91+
"xo": "^0.30.0"
9592
},
9693
"types": "dist/source",
9794
"sideEffects": false,
@@ -115,10 +112,6 @@
115112
]
116113
},
117114
"xo": {
118-
"extends": "xo-typescript",
119-
"extensions": [
120-
"ts"
121-
],
122115
"ignores": [
123116
"documentation/examples/*"
124117
],
@@ -127,11 +120,10 @@
127120
"@typescript-eslint/no-base-to-string": "off",
128121
"node/prefer-global/url": "off",
129122
"node/prefer-global/url-search-params": "off",
130-
"unicorn/string-content": "off",
131123
"@typescript-eslint/prefer-readonly-parameter-types": "off",
132-
"@typescript-eslint/no-unsafe-member-access": "off",
133-
"@typescript-eslint/no-unsafe-call": "off",
134-
"@typescript-eslint/no-unsafe-return": "off"
124+
"@typescript-eslint/no-floating-promises": "off",
125+
"@typescript-eslint/method-signature-style": "off",
126+
"unicorn/no-fn-reference-in-iterator": "off"
135127
}
136128
}
137129
}

test/agent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const prepareServer = (server: ExtendedTestServer): void => {
3131
});
3232
};
3333

34-
const createAgentSpy = <T extends HttpAgent>(AgentClass: Constructor): {agent: T; spy: sinon.SinonSpy} => {
34+
const createAgentSpy = <T extends HttpsAgent>(AgentClass: Constructor): {agent: T; spy: sinon.SinonSpy} => {
3535
const agent: T = new AgentClass({keepAlive: true});
3636
// @ts-ignore This IS correct
3737
const spy = sinon.spy(agent, 'addRequest');
@@ -136,6 +136,7 @@ test('socket connect listener cleaned up after request', withServer, async (t, s
136136
});
137137
}
138138

139+
// @ts-ignore
139140
for (const value of Object.values(agent.freeSockets) as [Socket[]]) {
140141
for (const sock of value) {
141142
t.is(sock.listenerCount('connect'), 0);

test/arguments.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ test('throws if cannot change `prefixUrl`', async t => {
303303
test('throws if the `searchParams` value is invalid', async t => {
304304
// @ts-ignore Error tests
305305
await t.throwsAsync(got('https://example.com', {
306-
// @ts-ignore Error tests
307306
searchParams: {
307+
// @ts-ignore Error tests
308308
foo: []
309309
}
310310
}), {
@@ -367,6 +367,7 @@ test('`context` option is accessible when extending instances', t => {
367367
test('throws if `options.encoding` is `null`', async t => {
368368
// @ts-ignore Error tests
369369
await t.throwsAsync(got('https://example.com', {
370+
// @ts-ignore For testing purposes
370371
encoding: null
371372
}), {message: 'To get a Buffer, set `options.responseType` to `buffer` instead'});
372373
});
@@ -411,8 +412,8 @@ test('throws on leading slashes', async t => {
411412
});
412413

413414
test('throws on invalid `dnsCache` option', async t => {
414-
// @ts-ignore Error tests
415415
await t.throwsAsync(got('https://example.com', {
416+
// @ts-ignore Error tests
416417
dnsCache: 123
417418
}), {message: 'Parameter `dnsCache` must be a CacheableLookup instance or a boolean, got number'});
418419
});

test/cookies.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,19 @@ test('accepts custom `cookieJar` object', withServer, async (t, server, got) =>
176176
});
177177

178178
test('throws on invalid `options.cookieJar.setCookie`', async t => {
179-
// @ts-ignore Error tests
180179
await t.throwsAsync(got('https://example.com', {
181180
cookieJar: {
181+
// @ts-ignore Error tests
182182
setCookie: 123
183183
}
184184
}), {message: 'Expected value which is `Function`, received value of type `number`.'});
185185
});
186186

187187
test('throws on invalid `options.cookieJar.getCookieString`', async t => {
188-
// @ts-ignore Error tests
189188
await t.throwsAsync(got('https://example.com', {
190189
cookieJar: {
191190
setCookie: async () => {},
191+
// @ts-ignore Error tests
192192
getCookieString: 123
193193
}
194194
}), {message: 'Expected value which is `Function`, received value of type `number`.'});

test/headers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ test('buffer as `options.body` sets `content-length` header', withServer, async
200200
test('throws on null value headers', async t => {
201201
await t.throwsAsync(got({
202202
url: 'https://example.com',
203-
// @ts-ignore Testing purposes
204203
headers: {
204+
// @ts-ignore Testing purposes
205205
'user-agent': null
206206
}
207207
}), {

test/hooks.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const redirectEndpoint: Handler = (_request, response) => {
3939
test('async hooks', withServer, async (t, server, got) => {
4040
server.get('/', echoHeaders);
4141

42-
const {body} = await got({
42+
const {body} = await got<Record<string, string>>({
4343
responseType: 'json',
4444
hooks: {
4545
beforeRequest: [
@@ -325,7 +325,7 @@ test('beforeRequest is called with options', withServer, async (t, server, got)
325325
test('beforeRequest allows modifications', withServer, async (t, server, got) => {
326326
server.get('/', echoHeaders);
327327

328-
const {body} = await got({
328+
const {body} = await got<Record<string, string>>({
329329
responseType: 'json',
330330
hooks: {
331331
beforeRequest: [
@@ -386,7 +386,7 @@ test('beforeRedirect allows modifications', withServer, async (t, server, got) =
386386
server.get('/', echoHeaders);
387387
server.get('/redirect', redirectEndpoint);
388388

389-
const {body} = await got('redirect', {
389+
const {body} = await got<Record<string, string>>('redirect', {
390390
responseType: 'json',
391391
hooks: {
392392
beforeRedirect: [
@@ -427,7 +427,7 @@ test('beforeRetry allows modifications', withServer, async (t, server, got) => {
427427
server.get('/', echoHeaders);
428428
server.get('/retry', retryEndpoint);
429429

430-
const {body} = await got('retry', {
430+
const {body} = await got<Record<string, string>>('retry', {
431431
responseType: 'json',
432432
hooks: {
433433
beforeRetry: [
@@ -460,13 +460,12 @@ test('afterResponse is called with response', withServer, async (t, server, got)
460460
test('afterResponse allows modifications', withServer, async (t, server, got) => {
461461
server.get('/', echoHeaders);
462462

463-
const {body} = await got({
463+
const {body} = await got<Record<string, string>>({
464464
responseType: 'json',
465465
hooks: {
466466
afterResponse: [
467467
response => {
468468
response.body = {hello: 'world'};
469-
470469
return response;
471470
}
472471
]

test/post.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ test('`content-length` header disabled for chunked transfer-encoding', withServe
197197
test('`content-type` header is not overriden when object in `options.body`', withServer, async (t, server, got) => {
198198
server.post('/', echoHeaders);
199199

200-
const {body: headers} = await got.post({
200+
const {body: headers} = await got.post<Record<string, string>>({
201201
headers: {
202202
'content-type': 'doge'
203203
},

test/response-parse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ test('sets correct headers', withServer, async (t, server, got) => {
136136
response.end(JSON.stringify(request.headers));
137137
});
138138

139-
const {body: headers} = await got.post({responseType: 'json', json: {}});
139+
const {body: headers} = await got.post<Record<string, string>>({responseType: 'json', json: {}});
140140
t.is(headers['content-type'], 'application/json');
141141
t.is(headers.accept, 'application/json');
142142
});

test/timeout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,12 @@ test.serial('doesn\'t throw on early lookup', withServerAndLolex, async (t, serv
572572
response.end('ok');
573573
});
574574

575-
// @ts-ignore
576575
await t.notThrowsAsync(got('', {
577576
timeout: {
578577
lookup: 1
579578
},
580579
retry: 0,
580+
// @ts-ignore
581581
lookup: (...[_hostname, options, callback]: Parameters<CacheableLookup['lookup']>) => {
582582
if (typeof options === 'function') {
583583
callback = options;

0 commit comments

Comments
 (0)