pryv 2.3.9 → 2.4.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pryv",
3
- "version": "2.3.9",
3
+ "version": "2.4.0",
4
4
  "description": "Pryv JavaScript library",
5
5
  "keywords": [
6
6
  "Pryv",
@@ -14,11 +14,11 @@
14
14
  "type": "git",
15
15
  "url": "git://github.com/pryv/lib-js"
16
16
  },
17
- "dependencies": {
18
- "superagent": "^8.0.6"
19
- },
20
17
  "license": "BSD-3-Clause",
21
18
  "author": "Pryv S.A. <info@pryv.com> (https://pryv.com)",
22
19
  "main": "src/index.js",
23
- "types": "src/index.d.ts"
24
- }
20
+ "types": "src/index.d.ts",
21
+ "dependencies": {
22
+ "superagent": "^9.0.0"
23
+ }
24
+ }
@@ -369,6 +369,11 @@ describe('Connection', () => {
369
369
 
370
370
  if (typeof window === 'undefined') {
371
371
  describe('Browser mock', function () {
372
+ const isNotAvailable = {
373
+ URL: global.URL == null,
374
+ URLSearchParams: global.URLSearchParams == null,
375
+ fetch: global.fetch == null
376
+ };
372
377
  beforeEach(function () {
373
378
  const browser = new Browser();
374
379
  browser.visit('./');
@@ -378,18 +383,18 @@ describe('Connection', () => {
378
383
  function fetch (...args) {
379
384
  return browser.fetch(...args);
380
385
  }
381
- global.fetch = fetch;
382
- global.URL = URL;
383
- global.URLSearchParams = URLSearchParams;
386
+ if (isNotAvailable.fetch) global.fetch = fetch;
387
+ if (isNotAvailable.URL) global.URL = URL;
388
+ if (isNotAvailable.URLSearchParams) global.URLSearchParams = URLSearchParams;
384
389
  });
385
390
 
386
391
  afterEach(function () {
387
392
  delete global.document;
388
393
  delete global.window;
389
394
  delete global.location;
390
- delete global.fetch;
391
- delete global.URL;
392
- delete global.URLSearchParams;
395
+ if (isNotAvailable.fetch) delete global.fetch;
396
+ if (isNotAvailable.URL) delete global.URL;
397
+ if (isNotAvailable.URLSearchParams) delete global.URLSearchParams;
393
398
  });
394
399
 
395
400
  it(' without fetch', async () => {