@algolia/requester-browser-xhr 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":"createXhrRequester.d.ts","sourceRoot":"","sources":["../../../../packages/requester-browser-xhr/src/createXhrRequester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAY,MAAM,wBAAwB,CAAC;AAI9E,wBAAgB,kBAAkB,IAAI,SAAS,CAyE9C"}
1
+ {"version":3,"file":"createXhrRequester.d.ts","sourceRoot":"","sources":["../../src/createXhrRequester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAY,MAAM,wBAAwB,CAAC;AAI9E,wBAAgB,kBAAkB,IAAI,SAAS,CAyE9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"echoRequester.d.ts","sourceRoot":"","sources":["../../../../packages/requester-browser-xhr/src/echoRequester.ts"],"names":[],"mappings":"AACA,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":"AACA,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-browser-xhr",
3
- "version": "5.0.0-alpha.5",
3
+ "version": "5.0.0-alpha.8",
4
4
  "description": "Promise-based request library for browser using xhr.",
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",
@@ -122,8 +122,8 @@ describe('timeout handling', () => {
122
122
  const now = Date.now();
123
123
 
124
124
  expect(response.content).toBe('Connection timeout');
125
- expect(now - before).toBeGreaterThan(999);
126
- expect(now - before).toBeLessThan(1200);
125
+ expect(now - before).toBeGreaterThanOrEqual(999);
126
+ expect(now - before).toBeLessThanOrEqual(1200);
127
127
  });
128
128
 
129
129
  it('connection timeouts with the given 2 seconds connection timeout', async () => {
@@ -137,8 +137,8 @@ describe('timeout handling', () => {
137
137
  const now = Date.now();
138
138
 
139
139
  expect(response.content).toBe('Connection timeout');
140
- expect(now - before).toBeGreaterThan(1990);
141
- expect(now - before).toBeLessThan(2200);
140
+ expect(now - before).toBeGreaterThanOrEqual(1990);
141
+ expect(now - before).toBeLessThanOrEqual(2200);
142
142
  });
143
143
 
144
144
  it("socket timeouts if response don't appears before the timeout with 2 seconds timeout", async () => {
@@ -153,8 +153,8 @@ describe('timeout handling', () => {
153
153
  const now = Date.now();
154
154
 
155
155
  expect(response.content).toBe('Socket timeout');
156
- expect(now - before).toBeGreaterThan(1990);
157
- expect(now - before).toBeLessThan(2200);
156
+ expect(now - before).toBeGreaterThanOrEqual(1990);
157
+ expect(now - before).toBeLessThanOrEqual(2200);
158
158
  });
159
159
 
160
160
  it("socket timeouts if response don't appears before the timeout with 3 seconds timeout", async () => {
@@ -169,8 +169,8 @@ describe('timeout handling', () => {
169
169
  const now = Date.now();
170
170
 
171
171
  expect(response.content).toBe('Socket timeout');
172
- expect(now - before).toBeGreaterThan(2999);
173
- expect(now - before).toBeLessThan(3200);
172
+ expect(now - before).toBeGreaterThanOrEqual(2999);
173
+ expect(now - before).toBeLessThanOrEqual(3200);
174
174
  });
175
175
 
176
176
  it('do not timeouts if response appears before the timeout', async () => {
@@ -186,8 +186,8 @@ describe('timeout handling', () => {
186
186
  expect(response.isTimedOut).toBe(false);
187
187
  expect(response.status).toBe(200);
188
188
  expect(response.content).toBe('{"foo": "bar"}');
189
- expect(now - before).toBeGreaterThan(4999);
190
- expect(now - before).toBeLessThan(5200);
189
+ expect(now - before).toBeGreaterThanOrEqual(4999);
190
+ expect(now - before).toBeLessThanOrEqual(5200);
191
191
  }, 10000); // This is a long-running test, default server timeout is set to 5000ms
192
192
  });
193
193