@algolia/requester-node-http 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":"createHttpRequester.d.ts","sourceRoot":"","sources":["../../../../packages/requester-node-http/src/createHttpRequester.ts"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAc,SAAS,EAAY,MAAM,wBAAwB,CAAC;AAE9E,oBAAY,0BAA0B,GAAG,OAAO,CAAC;IAC/C,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAChC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;IACtB,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC;IACxB;;OAEG;IACH,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC;CACxC,CAAC,CAAC;AAOH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,cAAc,EAC1B,gBAAqB,GACtB,GAAE,0BAA+B,GAAG,SAAS,CA6F7C"}
1
+ {"version":3,"file":"createHttpRequester.d.ts","sourceRoot":"","sources":["../../src/createHttpRequester.ts"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAc,SAAS,EAAY,MAAM,wBAAwB,CAAC;AAE9E,oBAAY,0BAA0B,GAAG,OAAO,CAAC;IAC/C,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAChC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;IACtB,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC;IACxB;;OAEG;IACH,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC;CACxC,CAAC,CAAC;AAOH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,cAAc,EAC1B,gBAAqB,GACtB,GAAE,0BAA+B,GAAG,SAAS,CA6F7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"echoRequester.d.ts","sourceRoot":"","sources":["../../../../packages/requester-node-http/src/echoRequester.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,wBAAgB,aAAa,CAAC,MAAM,GAAE,MAAY,GAAG,SAAS,CAE7D"}
1
+ {"version":3,"file":"echoRequester.d.ts","sourceRoot":"","sources":["../../src/echoRequester.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,wBAAgB,aAAa,CAAC,MAAM,GAAE,MAAY,GAAG,SAAS,CAE7D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/requester-node-http",
3
- "version": "5.0.0-alpha.5",
3
+ "version": "5.0.0-alpha.8",
4
4
  "description": "Promise-based request library for node using the native http module.",
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
- "clean": "rm -rf dist/",
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.5"
22
+ "@algolia/client-common": "5.0.0-alpha.8"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/jest": "28.1.6",
@@ -192,8 +192,8 @@ describe('timeout handling', () => {
192
192
  const now = Date.now();
193
193
 
194
194
  expect(response.content).toBe('Connection timeout');
195
- expect(now - before).toBeGreaterThan(999);
196
- expect(now - before).toBeLessThan(1200);
195
+ expect(now - before).toBeGreaterThanOrEqual(999);
196
+ expect(now - before).toBeLessThanOrEqual(1200);
197
197
  });
198
198
 
199
199
  it('connection timeouts with the given 2 seconds connection timeout', async () => {
@@ -207,8 +207,8 @@ describe('timeout handling', () => {
207
207
  const now = Date.now();
208
208
 
209
209
  expect(response.content).toBe('Connection timeout');
210
- expect(now - before).toBeGreaterThan(1999);
211
- expect(now - before).toBeLessThan(2200);
210
+ expect(now - before).toBeGreaterThanOrEqual(1999);
211
+ expect(now - before).toBeLessThanOrEqual(2200);
212
212
  });
213
213
 
214
214
  it("socket timeouts if response don't appears before the timeout with 2 seconds timeout", async () => {
@@ -223,8 +223,8 @@ describe('timeout handling', () => {
223
223
  const now = Date.now();
224
224
 
225
225
  expect(response.content).toBe('Socket timeout');
226
- expect(now - before).toBeGreaterThan(1999);
227
- expect(now - before).toBeLessThan(2200);
226
+ expect(now - before).toBeGreaterThanOrEqual(1999);
227
+ expect(now - before).toBeLessThanOrEqual(2200);
228
228
  });
229
229
 
230
230
  it("socket timeouts if response don't appears before the timeout with 3 seconds timeout", async () => {
@@ -238,8 +238,8 @@ describe('timeout handling', () => {
238
238
  const now = Date.now();
239
239
 
240
240
  expect(response.content).toBe('Socket timeout');
241
- expect(now - before).toBeGreaterThan(2999);
242
- expect(now - before).toBeLessThan(3200);
241
+ expect(now - before).toBeGreaterThanOrEqual(2999);
242
+ expect(now - before).toBeLessThanOrEqual(3200);
243
243
  });
244
244
 
245
245
  it('do not timeouts if response appears before the timeout', async () => {
@@ -255,8 +255,8 @@ describe('timeout handling', () => {
255
255
  expect(response.isTimedOut).toBe(false);
256
256
  expect(response.status).toBe(200);
257
257
  expect(response.content).toBe('{"foo": "bar"}');
258
- expect(now - before).toBeGreaterThan(4999);
259
- expect(now - before).toBeLessThan(5200);
258
+ expect(now - before).toBeGreaterThanOrEqual(4999);
259
+ expect(now - before).toBeLessThanOrEqual(5200);
260
260
  }, 10000); // This is a long-running test, default server timeout is set to 5000ms
261
261
  });
262
262