@algolia/requester-fetch 5.0.0-alpha.5 → 5.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFetchRequester.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"createFetchRequester.d.ts","sourceRoot":"","sources":["../../src/createFetchRequester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EAEV,MAAM,wBAAwB,CAAC;AAahC,oBAAY,qBAAqB,GAAG;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC;CACzC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,gBAAqB,GACtB,GAAE,qBAA0B,GAAG,SAAS,CAyDxC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/requester-fetch",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.8",
|
|
4
4
|
"description": "Promise-based request library using Fetch.",
|
|
5
5
|
"repository": "algolia/algoliasearch-client-javascript",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
"index.ts"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"
|
|
17
|
+
"build": "yarn clean && rollup --config",
|
|
18
|
+
"clean": "rm -rf ./dist || true",
|
|
18
19
|
"test": "jest"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@algolia/client-common": "5.0.0-alpha.
|
|
22
|
+
"@algolia/client-common": "5.0.0-alpha.8"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@types/jest": "28.1.6",
|
|
@@ -136,8 +136,8 @@ describe('timeout handling', () => {
|
|
|
136
136
|
const now = Date.now();
|
|
137
137
|
|
|
138
138
|
expect(response.content).toBe('Connection timeout');
|
|
139
|
-
expect(now - before).
|
|
140
|
-
expect(now - before).
|
|
139
|
+
expect(now - before).toBeGreaterThanOrEqual(999);
|
|
140
|
+
expect(now - before).toBeLessThanOrEqual(1200);
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
it('connection timeouts with the given 2 seconds connection timeout', async () => {
|
|
@@ -151,8 +151,8 @@ describe('timeout handling', () => {
|
|
|
151
151
|
const now = Date.now();
|
|
152
152
|
|
|
153
153
|
expect(response.content).toBe('Connection timeout');
|
|
154
|
-
expect(now - before).
|
|
155
|
-
expect(now - before).
|
|
154
|
+
expect(now - before).toBeGreaterThanOrEqual(1999);
|
|
155
|
+
expect(now - before).toBeLessThanOrEqual(2200);
|
|
156
156
|
});
|
|
157
157
|
|
|
158
158
|
it("socket timeouts if response don't appears before the timeout with 2 seconds timeout", async () => {
|
|
@@ -167,8 +167,8 @@ describe('timeout handling', () => {
|
|
|
167
167
|
const now = Date.now();
|
|
168
168
|
|
|
169
169
|
expect(response.content).toBe('Socket timeout');
|
|
170
|
-
expect(now - before).
|
|
171
|
-
expect(now - before).
|
|
170
|
+
expect(now - before).toBeGreaterThanOrEqual(1999);
|
|
171
|
+
expect(now - before).toBeLessThanOrEqual(2200);
|
|
172
172
|
});
|
|
173
173
|
|
|
174
174
|
it("socket timeouts if response don't appears before the timeout with 3 seconds timeout", async () => {
|
|
@@ -182,8 +182,8 @@ describe('timeout handling', () => {
|
|
|
182
182
|
const now = Date.now();
|
|
183
183
|
|
|
184
184
|
expect(response.content).toBe('Socket timeout');
|
|
185
|
-
expect(now - before).
|
|
186
|
-
expect(now - before).
|
|
185
|
+
expect(now - before).toBeGreaterThanOrEqual(2999);
|
|
186
|
+
expect(now - before).toBeLessThanOrEqual(3200);
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
it('do not timeouts if response appears before the timeout', async () => {
|
|
@@ -199,8 +199,8 @@ describe('timeout handling', () => {
|
|
|
199
199
|
expect(response.isTimedOut).toBe(false);
|
|
200
200
|
expect(response.status).toBe(200);
|
|
201
201
|
expect(response.content).toBe('{"foo": "bar"}');
|
|
202
|
-
expect(now - before).
|
|
203
|
-
expect(now - before).
|
|
202
|
+
expect(now - before).toBeGreaterThanOrEqual(4999);
|
|
203
|
+
expect(now - before).toBeLessThanOrEqual(5200);
|
|
204
204
|
}, 10000); // This is a long-running test, default server timeout is set to 5000ms
|
|
205
205
|
});
|
|
206
206
|
|