Skip to content

Commit 8263bf2

Browse files
committed
fix: revert Array<T> back to T[] — oxlint considers interfaces as simple types
1 parent 97e068d commit 8263bf2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

test/unit/http-request.test.mts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ abc123def456789012345678901234567890123456789012345678901234abcd
18191819

18201820
describe('hooks', () => {
18211821
it('should call onRequest with method, url, headers, and timeout', async () => {
1822-
const requestInfos: Array<HttpHookRequestInfo> = []
1822+
const requestInfos: HttpHookRequestInfo[] = []
18231823
await httpRequest(`${httpBaseUrl}/json`, {
18241824
headers: { 'X-Custom': 'test-value' },
18251825
hooks: {
@@ -1835,7 +1835,7 @@ abc123def456789012345678901234567890123456789012345678901234abcd
18351835
})
18361836

18371837
it('should call onResponse with status, headers, and duration', async () => {
1838-
const responseInfos: Array<HttpHookResponseInfo> = []
1838+
const responseInfos: HttpHookResponseInfo[] = []
18391839
await httpRequest(`${httpBaseUrl}/json`, {
18401840
hooks: {
18411841
onResponse: info => responseInfos.push(info),
@@ -1854,7 +1854,7 @@ abc123def456789012345678901234567890123456789012345678901234abcd
18541854
})
18551855

18561856
it('should call onResponse with error on timeout', async () => {
1857-
const responseInfos: Array<HttpHookResponseInfo> = []
1857+
const responseInfos: HttpHookResponseInfo[] = []
18581858
await httpRequest(`${httpBaseUrl}/timeout`, {
18591859
timeout: 50,
18601860
hooks: {
@@ -1866,8 +1866,8 @@ abc123def456789012345678901234567890123456789012345678901234abcd
18661866
})
18671867

18681868
it('should fire hooks per-attempt on retries', async () => {
1869-
const requestInfos: Array<HttpHookRequestInfo> = []
1870-
const responseInfos: Array<HttpHookResponseInfo> = []
1869+
const requestInfos: HttpHookRequestInfo[] = []
1870+
const responseInfos: HttpHookResponseInfo[] = []
18711871

18721872
let attemptCount = 0
18731873
const testServer = http.createServer((_req, _res) => {
@@ -1905,8 +1905,8 @@ abc123def456789012345678901234567890123456789012345678901234abcd
19051905
})
19061906

19071907
it('should fire hooks on redirect hops with correct status codes', async () => {
1908-
const requestInfos: Array<HttpHookRequestInfo> = []
1909-
const responseInfos: Array<HttpHookResponseInfo> = []
1908+
const requestInfos: HttpHookRequestInfo[] = []
1909+
const responseInfos: HttpHookResponseInfo[] = []
19101910

19111911
await httpRequest(`${httpBaseUrl}/redirect`, {
19121912
hooks: {
@@ -1922,7 +1922,7 @@ abc123def456789012345678901234567890123456789012345678901234abcd
19221922
})
19231923

19241924
it('should report POST method in hook info', async () => {
1925-
const requestInfos: Array<HttpHookRequestInfo> = []
1925+
const requestInfos: HttpHookRequestInfo[] = []
19261926
await httpRequest(`${httpBaseUrl}/echo-body`, {
19271927
method: 'POST',
19281928
body: 'test',
@@ -1939,14 +1939,14 @@ abc123def456789012345678901234567890123456789012345678901234abcd
19391939
})
19401940

19411941
it('should pass hooks through httpJson and httpText', async () => {
1942-
const jsonInfos: Array<HttpHookResponseInfo> = []
1942+
const jsonInfos: HttpHookResponseInfo[] = []
19431943
await httpJson(`${httpBaseUrl}/json`, {
19441944
hooks: { onResponse: info => jsonInfos.push(info) },
19451945
})
19461946
expect(jsonInfos).toHaveLength(1)
19471947
expect(jsonInfos[0]!.status).toBe(200)
19481948

1949-
const textInfos: Array<HttpHookResponseInfo> = []
1949+
const textInfos: HttpHookResponseInfo[] = []
19501950
await httpText(`${httpBaseUrl}/text`, {
19511951
hooks: { onResponse: info => textInfos.push(info) },
19521952
})
@@ -2013,7 +2013,7 @@ abc123def456789012345678901234567890123456789012345678901234abcd
20132013
})
20142014

20152015
it('should fire onResponse hook with error on size limit', async () => {
2016-
const responseInfos: Array<HttpHookResponseInfo> = []
2016+
const responseInfos: HttpHookResponseInfo[] = []
20172017
await httpRequest(`${httpBaseUrl}/large-body`, {
20182018
maxResponseSize: 50,
20192019
hooks: {

0 commit comments

Comments
 (0)