@webex/http-core 2.59.3-next.1 → 2.59.4-next.1

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.
Files changed (44) hide show
  1. package/.eslintrc.js +6 -6
  2. package/README.md +64 -64
  3. package/babel.config.js +3 -3
  4. package/dist/http-error-subtypes.js +57 -57
  5. package/dist/http-error-subtypes.js.map +1 -1
  6. package/dist/http-error.js +27 -27
  7. package/dist/http-error.js.map +1 -1
  8. package/dist/index.js +9 -8
  9. package/dist/index.js.map +1 -1
  10. package/dist/interceptors/http-status.js +13 -13
  11. package/dist/interceptors/http-status.js.map +1 -1
  12. package/dist/lib/detect.js +6 -6
  13. package/dist/lib/detect.js.map +1 -1
  14. package/dist/lib/interceptor.js +39 -36
  15. package/dist/lib/interceptor.js.map +1 -1
  16. package/dist/lib/xhr.js +2 -2
  17. package/dist/lib/xhr.js.map +1 -1
  18. package/dist/progress-event.js +12 -8
  19. package/dist/progress-event.js.map +1 -1
  20. package/dist/request/index.js +11 -11
  21. package/dist/request/index.js.map +1 -1
  22. package/dist/request/request.js +14 -14
  23. package/dist/request/request.js.map +1 -1
  24. package/dist/request/request.shim.js +71 -73
  25. package/dist/request/request.shim.js.map +1 -1
  26. package/jest.config.js +3 -3
  27. package/package.json +11 -11
  28. package/process +1 -1
  29. package/src/http-error-subtypes.js +187 -187
  30. package/src/http-error.js +147 -147
  31. package/src/index.js +58 -58
  32. package/src/interceptors/http-status.js +63 -63
  33. package/src/lib/detect.js +33 -33
  34. package/src/lib/interceptor.js +95 -95
  35. package/src/lib/xhr.js +258 -258
  36. package/src/progress-event.js +37 -37
  37. package/src/request/index.js +62 -62
  38. package/src/request/request.js +109 -109
  39. package/src/request/request.shim.js +304 -304
  40. package/test/integration/spec/http-error.js +188 -188
  41. package/test/integration/spec/interceptor.js +71 -71
  42. package/test/integration/spec/progress-event.js +83 -83
  43. package/test/integration/spec/request.js +310 -310
  44. package/test/unit/spec/interceptors/http-status.js +49 -49
@@ -1,83 +1,83 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
-
5
- import {assert} from '@webex/test-helper-chai';
6
- import {ProgressEvent} from '@webex/http-core';
7
-
8
- describe('http-core', () => {
9
- describe('ProgressEvent', () => {
10
- let event;
11
-
12
- const loaded = 100;
13
- const total = 500;
14
-
15
- beforeEach(() => {
16
- event = new ProgressEvent(loaded, total);
17
- });
18
-
19
- describe('#loaded', () => {
20
- it('exists', () => {
21
- assert.property(event, 'loaded');
22
- });
23
-
24
- it('matches the value passed to the constructor', () => {
25
- assert.equal(event.loaded, loaded);
26
- });
27
- });
28
-
29
- describe('#total', () => {
30
- it('exists', () => {
31
- assert.property(event, 'total');
32
- });
33
-
34
- it('matches the value passed to the constructor', () => {
35
- assert.equal(event.total, total);
36
- });
37
- });
38
-
39
- describe('#lengthComputable', () => {
40
- it('exists', () => {
41
- assert.property(event, 'lengthComputable');
42
- });
43
-
44
- it('indicates that request progress can be computed', () => {
45
- assert.isTrue(event.lengthComputable);
46
- [
47
- {
48
- loaded: undefined,
49
- total: undefined,
50
- result: false,
51
- },
52
- {
53
- loaded: 10,
54
- total: undefined,
55
- result: false,
56
- },
57
- {
58
- loaded: undefined,
59
- total: 10,
60
- result: false,
61
- },
62
- {
63
- loaded: 10,
64
- total: 10,
65
- result: true,
66
- },
67
- {
68
- loaded: 10,
69
- total: 0,
70
- result: false,
71
- },
72
- {
73
- loaded: 0,
74
- total: 0,
75
- result: false,
76
- },
77
- ].forEach((item) => {
78
- assert.equal(new ProgressEvent(item.loaded, item.total).lengthComputable, item.result);
79
- });
80
- });
81
- });
82
- });
83
- });
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import {assert} from '@webex/test-helper-chai';
6
+ import {ProgressEvent} from '@webex/http-core';
7
+
8
+ describe('http-core', () => {
9
+ describe('ProgressEvent', () => {
10
+ let event;
11
+
12
+ const loaded = 100;
13
+ const total = 500;
14
+
15
+ beforeEach(() => {
16
+ event = new ProgressEvent(loaded, total);
17
+ });
18
+
19
+ describe('#loaded', () => {
20
+ it('exists', () => {
21
+ assert.property(event, 'loaded');
22
+ });
23
+
24
+ it('matches the value passed to the constructor', () => {
25
+ assert.equal(event.loaded, loaded);
26
+ });
27
+ });
28
+
29
+ describe('#total', () => {
30
+ it('exists', () => {
31
+ assert.property(event, 'total');
32
+ });
33
+
34
+ it('matches the value passed to the constructor', () => {
35
+ assert.equal(event.total, total);
36
+ });
37
+ });
38
+
39
+ describe('#lengthComputable', () => {
40
+ it('exists', () => {
41
+ assert.property(event, 'lengthComputable');
42
+ });
43
+
44
+ it('indicates that request progress can be computed', () => {
45
+ assert.isTrue(event.lengthComputable);
46
+ [
47
+ {
48
+ loaded: undefined,
49
+ total: undefined,
50
+ result: false,
51
+ },
52
+ {
53
+ loaded: 10,
54
+ total: undefined,
55
+ result: false,
56
+ },
57
+ {
58
+ loaded: undefined,
59
+ total: 10,
60
+ result: false,
61
+ },
62
+ {
63
+ loaded: 10,
64
+ total: 10,
65
+ result: true,
66
+ },
67
+ {
68
+ loaded: 10,
69
+ total: 0,
70
+ result: false,
71
+ },
72
+ {
73
+ loaded: 0,
74
+ total: 0,
75
+ result: false,
76
+ },
77
+ ].forEach((item) => {
78
+ assert.equal(new ProgressEvent(item.loaded, item.total).lengthComputable, item.result);
79
+ });
80
+ });
81
+ });
82
+ });
83
+ });