@algolia/requester-fetch
Advanced tools
Comparing version 5.3.2 to 5.4.0
{ | ||
"name": "@algolia/requester-fetch", | ||
"version": "5.3.2", | ||
"version": "5.4.0", | ||
"description": "Promise-based request library using Fetch.", | ||
@@ -24,6 +24,11 @@ "repository": { | ||
}, | ||
"worker": { | ||
"types": "./dist/requester.fetch.node.d.ts", | ||
"default": "./dist/requester.fetch.node.js" | ||
}, | ||
"default": { | ||
"types": "./dist/requester.fetch.browser.d.ts", | ||
"module": "./dist/requester.fetch.browser.js", | ||
"import": "./dist/requester.fetch.browser.js" | ||
"import": "./dist/requester.fetch.browser.js", | ||
"default": "./dist/requester.fetch.browser.js" | ||
} | ||
@@ -41,21 +46,17 @@ }, | ||
"clean": "rm -rf ./dist || true", | ||
"test": "jest", | ||
"test": "vitest --run", | ||
"test:bundle": "publint . && attw --pack ." | ||
}, | ||
"dependencies": { | ||
"@algolia/client-common": "5.3.2" | ||
"@algolia/client-common": "5.4.0" | ||
}, | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "0.16.1", | ||
"@babel/preset-env": "7.25.4", | ||
"@babel/preset-typescript": "7.24.7", | ||
"@types/jest": "29.5.12", | ||
"@types/node": "22.5.1", | ||
"cross-fetch": "4.0.0", | ||
"jest": "29.7.0", | ||
"nock": "13.5.5", | ||
"publint": "0.2.10", | ||
"ts-jest": "29.2.5", | ||
"tsup": "8.2.4", | ||
"typescript": "5.5.4" | ||
"typescript": "5.5.4", | ||
"vitest": "2.0.5" | ||
}, | ||
@@ -62,0 +63,0 @@ "engines": { |
@@ -7,2 +7,3 @@ import type http from 'http'; | ||
import nock from 'nock'; | ||
import { describe, test, beforeAll, afterAll, beforeEach, afterEach, expect } from 'vitest'; | ||
@@ -33,3 +34,3 @@ import { createFetchRequester } from '../..'; | ||
describe('status code handling', () => { | ||
it('sends requests', async () => { | ||
test('sends requests', async () => { | ||
const body = getStringifiedBody(); | ||
@@ -44,3 +45,3 @@ | ||
it('resolves status 200', async () => { | ||
test('resolves status 200', async () => { | ||
const body = getStringifiedBody(); | ||
@@ -57,3 +58,3 @@ | ||
it('resolves status 300', async () => { | ||
test('resolves status 300', async () => { | ||
const reason = 'Multiple Choices'; | ||
@@ -70,3 +71,3 @@ | ||
it('resolves status 400', async () => { | ||
test('resolves status 400', async () => { | ||
const body = getStringifiedBody({ | ||
@@ -85,3 +86,3 @@ message: 'Invalid Application-Id or API-Key', | ||
it('handles chunked responses inside unicode character boundaries', async () => { | ||
test('handles chunked responses inside unicode character boundaries', async () => { | ||
const data = Buffer.from('äöü'); | ||
@@ -115,7 +116,10 @@ | ||
afterAll((done) => { | ||
server.close(() => done()); | ||
}); | ||
afterAll( | ||
() => | ||
new Promise((done) => { | ||
done(); | ||
}), | ||
); | ||
it('timeouts with the given 1 seconds connection timeout', async () => { | ||
test('timeouts with the given 1 seconds connection timeout', async () => { | ||
const before = Date.now(); | ||
@@ -135,3 +139,3 @@ const response = await requester.send({ | ||
it('connection timeouts with the given 2 seconds connection timeout', async () => { | ||
test('connection timeouts with the given 2 seconds connection timeout', async () => { | ||
const before = Date.now(); | ||
@@ -151,3 +155,3 @@ const response = await requester.send({ | ||
it("socket timeouts if response don't appears before the timeout with 2 seconds timeout", async () => { | ||
test("socket timeouts if response don't appears before the timeout with 2 seconds timeout", async () => { | ||
const before = Date.now(); | ||
@@ -168,3 +172,3 @@ | ||
it("socket timeouts if response don't appears before the timeout with 3 seconds timeout", async () => { | ||
test("socket timeouts if response don't appears before the timeout with 3 seconds timeout", async () => { | ||
const before = Date.now(); | ||
@@ -184,3 +188,3 @@ const response = await requester.send({ | ||
it('do not timeouts if response appears before the timeout', async () => { | ||
test('do not timeouts if response appears before the timeout', async () => { | ||
const before = Date.now(); | ||
@@ -204,3 +208,3 @@ const response = await requester.send({ | ||
describe('error handling', (): void => { | ||
it('resolves dns not found', async () => { | ||
test('resolves dns not found', async () => { | ||
const request: EndRequest = { | ||
@@ -222,3 +226,3 @@ url: 'https://this-dont-exist.algolia.com', | ||
it('resolves general network errors', async () => { | ||
test('resolves general network errors', async () => { | ||
nock(testQueryBaseUrl, { reqheaders: headers }) | ||
@@ -240,3 +244,3 @@ .post('/foo') | ||
describe('requesterOptions', () => { | ||
it('allows to pass requesterOptions', async () => { | ||
test('allows to pass requesterOptions', async () => { | ||
const body = getStringifiedBody(); | ||
@@ -265,3 +269,3 @@ const requesterTmp = createFetchRequester({ | ||
it('allows overriding default requesterOptions', async () => { | ||
test('allows overriding default requesterOptions', async () => { | ||
const body = getStringifiedBody(); | ||
@@ -268,0 +272,0 @@ const requesterTmp = createFetchRequester({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27510
8
445
+ Added@algolia/client-common@5.4.0(transitive)
- Removed@algolia/client-common@5.3.2(transitive)
Updated@algolia/client-common@5.4.0