@fluid-experimental/property-common 0.49.0 → 0.50.0-41540

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 (130) hide show
  1. package/dist/constants.d.ts +4 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +4 -0
  4. package/dist/constants.js.map +1 -1
  5. package/dist/packageVersion.d.ts +1 -1
  6. package/dist/packageVersion.d.ts.map +1 -1
  7. package/dist/packageVersion.js +1 -1
  8. package/dist/packageVersion.js.map +1 -1
  9. package/lib/chronometer.d.ts +55 -0
  10. package/lib/chronometer.d.ts.map +1 -0
  11. package/lib/chronometer.js +185 -0
  12. package/lib/chronometer.js.map +1 -0
  13. package/lib/consoleUtils.d.ts +16 -0
  14. package/lib/consoleUtils.d.ts.map +1 -0
  15. package/lib/consoleUtils.js +20 -0
  16. package/lib/consoleUtils.js.map +1 -0
  17. package/lib/constants.d.ts +1219 -0
  18. package/lib/constants.d.ts.map +1 -0
  19. package/lib/constants.js +1274 -0
  20. package/lib/constants.js.map +1 -0
  21. package/lib/datastructures/collection.d.ts +203 -0
  22. package/lib/datastructures/collection.d.ts.map +1 -0
  23. package/lib/datastructures/collection.js +377 -0
  24. package/lib/datastructures/collection.js.map +1 -0
  25. package/lib/datastructures/dataArray.d.ts +275 -0
  26. package/lib/datastructures/dataArray.d.ts.map +1 -0
  27. package/lib/datastructures/dataArray.js +497 -0
  28. package/lib/datastructures/dataArray.js.map +1 -0
  29. package/lib/datastructures/index.d.ts +9 -0
  30. package/lib/datastructures/index.d.ts.map +1 -0
  31. package/lib/datastructures/index.js +9 -0
  32. package/lib/datastructures/index.js.map +1 -0
  33. package/lib/datastructures/integer64.d.ts +47 -0
  34. package/lib/datastructures/integer64.d.ts.map +1 -0
  35. package/lib/datastructures/integer64.js +140 -0
  36. package/lib/datastructures/integer64.js.map +1 -0
  37. package/lib/datastructures/sortedCollection.d.ts +77 -0
  38. package/lib/datastructures/sortedCollection.d.ts.map +1 -0
  39. package/lib/datastructures/sortedCollection.js +140 -0
  40. package/lib/datastructures/sortedCollection.js.map +1 -0
  41. package/lib/deferredPromise.d.ts +28 -0
  42. package/lib/deferredPromise.d.ts.map +1 -0
  43. package/lib/deferredPromise.js +43 -0
  44. package/lib/deferredPromise.js.map +1 -0
  45. package/lib/deterministicRandomGenerator.d.ts +39 -0
  46. package/lib/deterministicRandomGenerator.d.ts.map +1 -0
  47. package/lib/deterministicRandomGenerator.js +83 -0
  48. package/lib/deterministicRandomGenerator.js.map +1 -0
  49. package/lib/error_objects/flaggedError.d.ts +29 -0
  50. package/lib/error_objects/flaggedError.d.ts.map +1 -0
  51. package/lib/error_objects/flaggedError.js +45 -0
  52. package/lib/error_objects/flaggedError.js.map +1 -0
  53. package/lib/error_objects/httpError.d.ts +31 -0
  54. package/lib/error_objects/httpError.d.ts.map +1 -0
  55. package/lib/error_objects/httpError.js +58 -0
  56. package/lib/error_objects/httpError.js.map +1 -0
  57. package/lib/error_objects/httpErrorNoStack.d.ts +25 -0
  58. package/lib/error_objects/httpErrorNoStack.d.ts.map +1 -0
  59. package/lib/error_objects/httpErrorNoStack.js +29 -0
  60. package/lib/error_objects/httpErrorNoStack.js.map +1 -0
  61. package/lib/error_objects/index.d.ts +9 -0
  62. package/lib/error_objects/index.d.ts.map +1 -0
  63. package/lib/error_objects/index.js +9 -0
  64. package/lib/error_objects/index.js.map +1 -0
  65. package/lib/error_objects/operationError.d.ts +32 -0
  66. package/lib/error_objects/operationError.d.ts.map +1 -0
  67. package/lib/error_objects/operationError.js +73 -0
  68. package/lib/error_objects/operationError.js.map +1 -0
  69. package/lib/guidUtils.d.ts +16 -0
  70. package/lib/guidUtils.d.ts.map +1 -0
  71. package/lib/guidUtils.js +297 -0
  72. package/lib/guidUtils.js.map +1 -0
  73. package/lib/hashCalculator.d.ts +6 -0
  74. package/lib/hashCalculator.d.ts.map +1 -0
  75. package/lib/hashCalculator.js +14 -0
  76. package/lib/hashCalculator.js.map +1 -0
  77. package/lib/index.d.ts +16 -0
  78. package/lib/index.d.ts.map +1 -0
  79. package/lib/index.js +16 -0
  80. package/lib/index.js.map +1 -0
  81. package/lib/joinPaths.d.ts +19 -0
  82. package/lib/joinPaths.d.ts.map +1 -0
  83. package/lib/joinPaths.js +28 -0
  84. package/lib/joinPaths.js.map +1 -0
  85. package/lib/packageVersion.d.ts +9 -0
  86. package/lib/packageVersion.d.ts.map +1 -0
  87. package/lib/packageVersion.js +9 -0
  88. package/lib/packageVersion.js.map +1 -0
  89. package/package.json +22 -2
  90. package/platform-dependent/package.json +1 -1
  91. package/src/constants.ts +5 -0
  92. package/src/packageVersion.ts +1 -1
  93. package/dist/test/chronometer.spec.js +0 -90
  94. package/dist/test/chronometer.spec.js.map +0 -1
  95. package/dist/test/datastructures/collection.spec.js +0 -401
  96. package/dist/test/datastructures/collection.spec.js.map +0 -1
  97. package/dist/test/datastructures/dataArray.spec.js +0 -79
  98. package/dist/test/datastructures/dataArray.spec.js.map +0 -1
  99. package/dist/test/datastructures/sortedCollection.spec.js +0 -106
  100. package/dist/test/datastructures/sortedCollection.spec.js.map +0 -1
  101. package/dist/test/deterministicRandomGenerator.spec.js +0 -18
  102. package/dist/test/deterministicRandomGenerator.spec.js.map +0 -1
  103. package/dist/test/error_objects/flaggedError.spec.js +0 -23
  104. package/dist/test/error_objects/flaggedError.spec.js.map +0 -1
  105. package/dist/test/error_objects/httpError.spec.js +0 -61
  106. package/dist/test/error_objects/httpError.spec.js.map +0 -1
  107. package/dist/test/error_objects/httpErrorNoStack.spec.js +0 -55
  108. package/dist/test/error_objects/httpErrorNoStack.spec.js.map +0 -1
  109. package/dist/test/error_objects/operationError.spec.js +0 -132
  110. package/dist/test/error_objects/operationError.spec.js.map +0 -1
  111. package/dist/test/guidUtils.spec.js +0 -184
  112. package/dist/test/guidUtils.spec.js.map +0 -1
  113. package/dist/test/strings/joinPaths.spec.js +0 -18
  114. package/dist/test/strings/joinPaths.spec.js.map +0 -1
  115. package/dist/test/tsconfig.tsbuildinfo +0 -2278
  116. package/nyc/mocha-junit-report.xml +0 -175
  117. package/src/test/chronometer.spec.ts +0 -99
  118. package/src/test/datastructures/collection.spec.ts +0 -567
  119. package/src/test/datastructures/dataArray.spec.ts +0 -81
  120. package/src/test/datastructures/sortedCollection.spec.ts +0 -128
  121. package/src/test/deterministicRandomGenerator.spec.ts +0 -18
  122. package/src/test/error_objects/flaggedError.spec.ts +0 -22
  123. package/src/test/error_objects/httpError.spec.ts +0 -68
  124. package/src/test/error_objects/httpErrorNoStack.spec.ts +0 -64
  125. package/src/test/error_objects/operationError.spec.ts +0 -152
  126. package/src/test/guidUtils.spec.ts +0 -213
  127. package/src/test/strings/joinPaths.spec.ts +0 -17
  128. package/src/test/tsconfig.json +0 -21
  129. package/tsconfig.esnext.tsbuildinfo +0 -824
  130. package/tsconfig.tsbuildinfo +0 -823
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataArray.spec.js","sourceRoot":"","sources":["../../../src/test/datastructures/dataArray.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH;;GAEG;AACH,+BAA8B;AAC9B,uCAKqB;AACrB,IAAI,KAAK,CAAC;AAEV,QAAQ,CAAC,eAAe,EAAE;IACtB,EAAE,CAAC,uEAAuE,EAAE;QACxE,MAAM,WAAW,GAAG,IAAI,sBAAc,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI;YACA,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACpC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YACzC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACjC;QAAC,OAAO,CAAC,EAAE;YACR,KAAK,GAAG,CAAC,CAAC;SACb;gBAAS;YACN,aAAM,CAAC,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I,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;SACxG;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;QACrC,MAAM,WAAW,GAAG,IAAI,qBAAa,CAAC,CAAC,CAAC,CAAC;QACzC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjD,aAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpC,aAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview In this file, we will test the functions exported by deep_copy.js\n */\nimport { expect } from \"chai\";\nimport {\n Int32DataArray,\n UniversalDataArray,\n Int8DataArray,\n BoolDataArray,\n} from \"../../index\";\nlet error;\n\ndescribe(\"BaseDataArray\", function() {\n it(\"should set, insert and remove some values in a (TypedArray) DataArray\", function() {\n const myDataArray = new Int32DataArray(5);\n try {\n myDataArray.set(0, [1, 2, 3, 4, 5]);\n myDataArray.insertRange(2, [31, 32, 33]);\n myDataArray.removeRange(3, 4);\n } catch (e) {\n error = e;\n } finally {\n expect(error).to.equal(undefined);\n expect(myDataArray.length).to.equal(4);\n expect(Array.prototype.slice.call(myDataArray.getBuffer())).to.deep.equal([1, 2, 31, 5]);\n }\n });\n\n it(\"should set, insert and remove some values in a UniversalArray\", function() {\n const myDataArray = new UniversalDataArray(5);\n try {\n console.log(\"UniversalArray: \", myDataArray);\n myDataArray.set(0, [\"1\", \"2\", \"3\", \"4\", \"5\"]);\n myDataArray.insertRange(2, [\"31\", \"32\", \"33\"]);\n myDataArray.removeRange(3, 4);\n } catch (e) {\n error = e;\n } finally {\n expect(error).to.equal(undefined);\n expect(myDataArray.length).to.equal(4);\n expect(Array.prototype.slice.call(myDataArray.getBuffer())).to.deep.equal([\"1\", \"2\", \"31\", \"5\"]);\n }\n });\n\n it(\"should get all elements from array\", function() {\n const myDataArray = new Int8DataArray(5);\n myDataArray.set(0, [1, 2, 3, 4, 5]);\n const subArray = myDataArray.getValueRange(0, 5);\n expect(subArray.length).to.equal(5);\n });\n});\n\ndescribe(\"BoolDataArray\", function() {\n it(\"should set, insert and remove some values\", function() {\n const myDataArray = new BoolDataArray(5);\n\n try {\n myDataArray.set(0, [1, 0, false, 1, true]);\n myDataArray.insertRange(2, [1, 0, false]);\n myDataArray.removeRange(3, 4);\n } catch (e) {\n error = e;\n } finally {\n expect(error).to.equal(undefined);\n expect(myDataArray.length).to.equal(4);\n expect(Array.prototype.slice.call(myDataArray.getBuffer())).to.deep.equal([true, false, true, true]);\n }\n });\n\n it(\"should get all elements from array\", function() {\n const myDataArray = new BoolDataArray(5);\n myDataArray.set(0, [true, false, true, false, false]);\n const subArray = myDataArray.getValueRange(1, 4);\n expect(subArray.length).to.equal(3);\n expect(subArray).to.deep.equal([false, true, false]);\n });\n});\n"]}
@@ -1,106 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- /* eslint-disable no-unused-expressions */
7
- /**
8
- * @fileoverview In this file, we will test the functions exported by datastructres/collection.js
9
- */
10
- var __importDefault = (this && this.__importDefault) || function (mod) {
11
- return (mod && mod.__esModule) ? mod : { "default": mod };
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- const semver_1 = __importDefault(require("semver"));
15
- const chai_1 = require("chai");
16
- const index_1 = require("../../index");
17
- describe("SortedCollection", function () {
18
- let collection;
19
- beforeEach(function () {
20
- collection = new index_1.SortedCollection();
21
- collection.setComparisonFunction(function (a, b) {
22
- if (semver_1.default.gt(a, b)) {
23
- return 1;
24
- }
25
- else if (semver_1.default.lt(a, b)) {
26
- return -1;
27
- }
28
- return 0;
29
- });
30
- collection.bulkAdd({
31
- "2.0.0": "2.0.0",
32
- "1.1.0": "1.1.0",
33
- "1.2.1": "1.2.1",
34
- "1.10.5": "1.10.5",
35
- "3.0.0": "3.0.0",
36
- "101.203.345": "101.203.345",
37
- "4.0.0": "4.0.0",
38
- "2.1.0": "2.1.0",
39
- });
40
- });
41
- it("should always sort the order of the keys after altering the collection", function () {
42
- chai_1.expect(collection._sortedKeys).to.eql(["1.1.0", "1.2.1", "1.10.5", "2.0.0", "2.1.0", "3.0.0", "4.0.0", "101.203.345"]);
43
- collection.remove("2.0.0");
44
- chai_1.expect(collection._sortedKeys).to.eql(["1.1.0", "1.2.1", "1.10.5", "2.1.0", "3.0.0", "4.0.0", "101.203.345"]);
45
- collection.bulkAdd({
46
- "5.0.0": "5.0.0",
47
- "0.0.1": "0.0.1",
48
- "2.3.9": "2.3.9",
49
- });
50
- chai_1.expect(collection._sortedKeys).to.eql([
51
- "0.0.1", "1.1.0", "1.2.1", "1.10.5", "2.1.0", "2.3.9", "3.0.0", "4.0.0", "5.0.0", "101.203.345",
52
- ]);
53
- collection.bulkRemove({
54
- "5.0.0": "5.0.0",
55
- "0.0.1": "0.0.1",
56
- "2.3.9": "2.3.9",
57
- });
58
- chai_1.expect(collection._sortedKeys).to.eql(["1.1.0", "1.2.1", "1.10.5", "2.1.0", "3.0.0", "4.0.0", "101.203.345"]);
59
- });
60
- it("should test against adding values for keys that are of type number or string", function () {
61
- const collection2 = new index_1.SortedCollection();
62
- collection2.add("6.0.0", "6.0.0");
63
- collection2.add(6.0, "6.0");
64
- collection2.add(6.2, "6.2");
65
- chai_1.expect(collection2.item("6.0.0")).to.equal("6.0.0");
66
- chai_1.expect(collection2.item(6.0)).to.equal("6.0");
67
- chai_1.expect(collection2.item("6")).to.equal("6.0");
68
- chai_1.expect(collection2.item(6.2)).to.equal("6.2");
69
- chai_1.expect(collection2.item("6.2")).to.equal("6.2");
70
- });
71
- it("should get the nearest next item in the collection", function () {
72
- let nearestNextItem = collection.getNearestNextItem("0.0.1");
73
- chai_1.expect(nearestNextItem).to.equal("1.1.0");
74
- nearestNextItem = collection.getNearestNextItem("5.0.0");
75
- chai_1.expect(nearestNextItem).to.equal("101.203.345");
76
- nearestNextItem = collection.getNearestNextItem("201.203.345");
77
- chai_1.expect(nearestNextItem).to.equal(undefined);
78
- nearestNextItem = collection.getNearestNextItem("2.0.1");
79
- chai_1.expect(nearestNextItem).to.equal("2.1.0");
80
- nearestNextItem = collection.getNearestNextItem("2.1.1");
81
- chai_1.expect(nearestNextItem).to.equal("3.0.0");
82
- nearestNextItem = collection.getNearestNextItem("3.0.0");
83
- chai_1.expect(nearestNextItem).to.equal("3.0.0");
84
- });
85
- it("should get the nearest previous item in the collection", function () {
86
- let nearestNextItem = collection.getNearestPreviousItem("0.0.1");
87
- chai_1.expect(nearestNextItem).to.equal(undefined);
88
- nearestNextItem = collection.getNearestPreviousItem("5.0.0");
89
- chai_1.expect(nearestNextItem).to.equal("4.0.0");
90
- nearestNextItem = collection.getNearestPreviousItem("201.203.345");
91
- chai_1.expect(nearestNextItem).to.equal("101.203.345");
92
- nearestNextItem = collection.getNearestPreviousItem("2.0.1");
93
- chai_1.expect(nearestNextItem).to.equal("2.0.0");
94
- nearestNextItem = collection.getNearestPreviousItem("2.1.1");
95
- chai_1.expect(nearestNextItem).to.equal("2.1.0");
96
- nearestNextItem = collection.getNearestNextItem("3.0.0");
97
- chai_1.expect(nearestNextItem).to.equal("3.0.0");
98
- });
99
- it("should clone the sorted collection", function () {
100
- const clone = collection.clone();
101
- chai_1.expect(clone instanceof index_1.SortedCollection).to.equal(true);
102
- chai_1.expect(clone._sortedKeys).
103
- to.eql(["1.1.0", "1.2.1", "1.10.5", "2.0.0", "2.1.0", "3.0.0", "4.0.0", "101.203.345"]);
104
- });
105
- });
106
- //# sourceMappingURL=sortedCollection.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sortedCollection.spec.js","sourceRoot":"","sources":["../../../src/test/datastructures/sortedCollection.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,0CAA0C;AAC1C;;GAEG;;;;;AAEH,oDAA4B;AAC5B,+BAA8B;AAC9B,uCAA+C;AAE/C,QAAQ,CAAC,kBAAkB,EAAE;IACzB,IAAI,UAAU,CAAC;IACf,UAAU,CAAC;QACP,UAAU,GAAG,IAAI,wBAAgB,EAAE,CAAC;QACpC,UAAU,CAAC,qBAAqB,CAAC,UAAS,CAAC,EAAE,CAAC;YAC1C,IAAI,gBAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;gBACjB,OAAO,CAAC,CAAC;aACZ;iBAAM,IAAI,gBAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;gBACxB,OAAO,CAAC,CAAC,CAAC;aACb;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,OAAO,CAAC;YACf,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO;YAChB,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,aAAa;YAC5B,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO;SACnB,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wEAAwE,EAAE;QACzE,aAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CACjC,CA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C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;QACjC,aAAM,CAAC,KAAK,YAAY,wBAAgB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzD,aAAM,CAAC,KAAK,CAAC,WAAW,CAAC;YACrB,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable no-unused-expressions */\n/**\n * @fileoverview In this file, we will test the functions exported by datastructres/collection.js\n */\n\nimport semver from \"semver\";\nimport { expect } from \"chai\";\nimport { SortedCollection } from \"../../index\";\n\ndescribe(\"SortedCollection\", function() {\n let collection;\n beforeEach(function() {\n collection = new SortedCollection();\n collection.setComparisonFunction(function(a, b) {\n if (semver.gt(a, b)) {\n return 1;\n } else if (semver.lt(a, b)) {\n return -1;\n }\n\n return 0;\n });\n\n collection.bulkAdd({\n \"2.0.0\": \"2.0.0\",\n \"1.1.0\": \"1.1.0\",\n \"1.2.1\": \"1.2.1\",\n \"1.10.5\": \"1.10.5\",\n \"3.0.0\": \"3.0.0\",\n \"101.203.345\": \"101.203.345\",\n \"4.0.0\": \"4.0.0\",\n \"2.1.0\": \"2.1.0\",\n });\n });\n\n it(\"should always sort the order of the keys after altering the collection\", function() {\n expect(collection._sortedKeys).to.eql(\n [\"1.1.0\", \"1.2.1\", \"1.10.5\", \"2.0.0\", \"2.1.0\", \"3.0.0\", \"4.0.0\", \"101.203.345\"],\n );\n\n collection.remove(\"2.0.0\");\n\n expect(collection._sortedKeys).to.eql(\n [\"1.1.0\", \"1.2.1\", \"1.10.5\", \"2.1.0\", \"3.0.0\", \"4.0.0\", \"101.203.345\"],\n );\n\n collection.bulkAdd({\n \"5.0.0\": \"5.0.0\",\n \"0.0.1\": \"0.0.1\",\n \"2.3.9\": \"2.3.9\",\n });\n\n expect(collection._sortedKeys).to.eql([\n \"0.0.1\", \"1.1.0\", \"1.2.1\", \"1.10.5\", \"2.1.0\", \"2.3.9\", \"3.0.0\", \"4.0.0\", \"5.0.0\", \"101.203.345\",\n ]);\n\n collection.bulkRemove({\n \"5.0.0\": \"5.0.0\",\n \"0.0.1\": \"0.0.1\",\n \"2.3.9\": \"2.3.9\",\n });\n\n expect(collection._sortedKeys).to.eql([\"1.1.0\", \"1.2.1\", \"1.10.5\", \"2.1.0\", \"3.0.0\", \"4.0.0\", \"101.203.345\"]);\n });\n\n it(\"should test against adding values for keys that are of type number or string\", function() {\n const collection2 = new SortedCollection<string>();\n collection2.add(\"6.0.0\", \"6.0.0\");\n collection2.add(6.0, \"6.0\");\n collection2.add(6.2, \"6.2\");\n expect(collection2.item(\"6.0.0\")).to.equal(\"6.0.0\");\n expect(collection2.item(6.0)).to.equal(\"6.0\");\n expect(collection2.item(\"6\")).to.equal(\"6.0\");\n expect(collection2.item(6.2)).to.equal(\"6.2\");\n expect(collection2.item(\"6.2\")).to.equal(\"6.2\");\n });\n\n it(\"should get the nearest next item in the collection\", function() {\n let nearestNextItem = collection.getNearestNextItem(\"0.0.1\");\n expect(nearestNextItem).to.equal(\"1.1.0\");\n\n nearestNextItem = collection.getNearestNextItem(\"5.0.0\");\n expect(nearestNextItem).to.equal(\"101.203.345\");\n\n nearestNextItem = collection.getNearestNextItem(\"201.203.345\");\n expect(nearestNextItem).to.equal(undefined);\n\n nearestNextItem = collection.getNearestNextItem(\"2.0.1\");\n expect(nearestNextItem).to.equal(\"2.1.0\");\n\n nearestNextItem = collection.getNearestNextItem(\"2.1.1\");\n expect(nearestNextItem).to.equal(\"3.0.0\");\n\n nearestNextItem = collection.getNearestNextItem(\"3.0.0\");\n expect(nearestNextItem).to.equal(\"3.0.0\");\n });\n\n it(\"should get the nearest previous item in the collection\", function() {\n let nearestNextItem = collection.getNearestPreviousItem(\"0.0.1\");\n expect(nearestNextItem).to.equal(undefined);\n\n nearestNextItem = collection.getNearestPreviousItem(\"5.0.0\");\n expect(nearestNextItem).to.equal(\"4.0.0\");\n\n nearestNextItem = collection.getNearestPreviousItem(\"201.203.345\");\n expect(nearestNextItem).to.equal(\"101.203.345\");\n\n nearestNextItem = collection.getNearestPreviousItem(\"2.0.1\");\n expect(nearestNextItem).to.equal(\"2.0.0\");\n\n nearestNextItem = collection.getNearestPreviousItem(\"2.1.1\");\n expect(nearestNextItem).to.equal(\"2.1.0\");\n\n nearestNextItem = collection.getNearestNextItem(\"3.0.0\");\n expect(nearestNextItem).to.equal(\"3.0.0\");\n });\n\n it(\"should clone the sorted collection\", function() {\n const clone = collection.clone();\n expect(clone instanceof SortedCollection).to.equal(true);\n expect(clone._sortedKeys).\n to.eql([\"1.1.0\", \"1.2.1\", \"1.10.5\", \"2.0.0\", \"2.1.0\", \"3.0.0\", \"4.0.0\", \"101.203.345\"]);\n });\n});\n"]}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- /**
8
- * @fileoverview In this file,we will test property-common.DeterministicRandomGenerator
9
- */
10
- const chai_1 = require("chai");
11
- const deterministicRandomGenerator_1 = require("../deterministicRandomGenerator");
12
- describe("property-common.DeterministicRandomGenerator", function () {
13
- it("should exist", function () {
14
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
15
- chai_1.expect(deterministicRandomGenerator_1.DeterministicRandomGenerator).to.exist;
16
- });
17
- });
18
- //# sourceMappingURL=deterministicRandomGenerator.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deterministicRandomGenerator.spec.js","sourceRoot":"","sources":["../../src/test/deterministicRandomGenerator.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH;;GAEG;AAEH,+BAA8B;AAC9B,kFAA+E;AAE/E,QAAQ,CAAC,8CAA8C,EAAE;IACrD,EAAE,CAAC,cAAc,EAAE;QACf,oEAAoE;QACpE,aAAM,CAAC,2DAA4B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview In this file,we will test property-common.DeterministicRandomGenerator\n */\n\nimport { expect } from \"chai\";\nimport { DeterministicRandomGenerator } from \"../deterministicRandomGenerator\";\n\ndescribe(\"property-common.DeterministicRandomGenerator\", function() {\n it(\"should exist\", function() {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n expect(DeterministicRandomGenerator).to.exist;\n });\n});\n"]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- /* eslint-disable max-nested-callbacks */
7
- /**
8
- * @fileoverview Tests the functions exported by error_objects/http_error.js
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const chai_1 = require("chai");
12
- const __1 = require("../..");
13
- describe("property-common.FlaggedError", function () {
14
- describe("Flags", function () {
15
- it("can be extended", function (done) {
16
- Object.keys(__1.FlaggedError.FLAGS).forEach(function (key, index) {
17
- chai_1.expect(__1.FlaggedError.FLAGS[key]).to.equal(Math.pow(2, index));
18
- });
19
- done();
20
- });
21
- });
22
- });
23
- //# sourceMappingURL=flaggedError.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flaggedError.spec.js","sourceRoot":"","sources":["../../../src/test/error_objects/flaggedError.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,yCAAyC;AACzC;;GAEG;;AAEH,+BAA8B;AAC9B,6BAAqC;AAErC,QAAQ,CAAC,8BAA8B,EAAE;IACrC,QAAQ,CAAC,OAAO,EAAE;QACd,EAAE,CAAC,iBAAiB,EAAE,UAAS,IAAI;YAC/B,MAAM,CAAC,IAAI,CAAC,gBAAY,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAS,GAAG,EAAE,KAAK;gBACvD,aAAM,CAAC,gBAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YACjE,CAAC,CAAC,CAAC;YACH,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable max-nested-callbacks */\n/**\n * @fileoverview Tests the functions exported by error_objects/http_error.js\n */\n\nimport { expect } from \"chai\";\nimport { FlaggedError } from \"../..\";\n\ndescribe(\"property-common.FlaggedError\", function() {\n describe(\"Flags\", function() {\n it(\"can be extended\", function(done) {\n Object.keys(FlaggedError.FLAGS).forEach(function(key, index) {\n expect(FlaggedError.FLAGS[key]).to.equal(Math.pow(2, index));\n });\n done();\n });\n });\n});\n"]}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- /**
8
- * @fileoverview Tests the functions exported by error_objects/http_error.js
9
- */
10
- const chai_1 = require("chai");
11
- const __1 = require("../..");
12
- describe("property-common.HTTPError", function () {
13
- const errorMsg = "a test error message";
14
- describe("object", function () {
15
- it("is instanceof Error", function (done) {
16
- chai_1.expect(new __1.HTTPError() instanceof Error).to.equal(true);
17
- done();
18
- });
19
- it("is instanceof HTTPError", function (done) {
20
- chai_1.expect(new __1.HTTPError() instanceof __1.HTTPError).to.equal(true);
21
- done();
22
- });
23
- });
24
- describe("toString", function () {
25
- it("basic error message", function (done) {
26
- const actual = new __1.HTTPError(errorMsg);
27
- chai_1.expect(actual.toString()).to.have.string(errorMsg);
28
- done();
29
- });
30
- });
31
- describe("JSON.stringify", function () {
32
- it("stringifies", function (done) {
33
- const actual = JSON.stringify(new __1.HTTPError(errorMsg));
34
- chai_1.expect(actual).to.have.string(errorMsg);
35
- done();
36
- });
37
- });
38
- describe("flags", function () {
39
- it("default at 0", function (done) {
40
- const actual = new __1.HTTPError(errorMsg);
41
- chai_1.expect(actual.flags).to.equal(0);
42
- done();
43
- });
44
- it("can be quiet", function (done) {
45
- const actual = new __1.HTTPError(errorMsg, undefined, undefined, undefined, undefined, __1.HTTPError.FLAGS.QUIET);
46
- chai_1.expect(actual.isQuiet()).to.equal(true);
47
- chai_1.expect(actual.flags).to.equal(__1.HTTPError.FLAGS.QUIET);
48
- done();
49
- });
50
- it("can be extended", function (done) {
51
- const actual =
52
- // eslint-disable-next-line no-bitwise
53
- new __1.HTTPError(errorMsg, undefined, undefined, undefined, undefined, __1.HTTPError.FLAGS.QUIET | 4);
54
- chai_1.expect(actual.isQuiet()).to.equal(true);
55
- // eslint-disable-next-line no-bitwise
56
- chai_1.expect(actual.flags).to.equal(__1.HTTPError.FLAGS.QUIET | 4);
57
- done();
58
- });
59
- });
60
- });
61
- //# sourceMappingURL=httpError.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpError.spec.js","sourceRoot":"","sources":["../../../src/test/error_objects/httpError.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH;;GAEG;AAEH,+BAA8B;AAC9B,6BAAkC;AAElC,QAAQ,CAAC,2BAA2B,EAAE;IAClC,MAAM,QAAQ,GAAG,sBAAsB,CAAC;IAExC,QAAQ,CAAC,QAAQ,EAAE;QACf,EAAE,CAAC,qBAAqB,EAAE,UAAS,IAAI;YACnC,aAAM,CAAC,IAAI,aAAS,EAAE,YAAY,KAAK,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CAAC;QAEH,EAAE,CAAC,cAAc,EAAE,UAAS,IAAI;YAC5B,MAAM,MAAM,GAAG,IAAI,aAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1G,aAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrD,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iBAAiB,EAAE,UAAS,IAAI;YAC/B,MAAM,MAAM;YACR,sCAAsC;YACtC,IAAI,aAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAS,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACnG,aAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,sCAAsC;YACtC,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAS,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACzD,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Tests the functions exported by error_objects/http_error.js\n */\n\nimport { expect } from \"chai\";\nimport { HTTPError } from \"../..\";\n\ndescribe(\"property-common.HTTPError\", function() {\n const errorMsg = \"a test error message\";\n\n describe(\"object\", function() {\n it(\"is instanceof Error\", function(done) {\n expect(new HTTPError() instanceof Error).to.equal(true);\n done();\n });\n\n it(\"is instanceof HTTPError\", function(done) {\n expect(new HTTPError() instanceof HTTPError).to.equal(true);\n done();\n });\n });\n\n describe(\"toString\", function() {\n it(\"basic error message\", function(done) {\n const actual = new HTTPError(errorMsg);\n expect(actual.toString()).to.have.string(errorMsg);\n done();\n });\n });\n\n describe(\"JSON.stringify\", function() {\n it(\"stringifies\", function(done) {\n const actual = JSON.stringify(new HTTPError(errorMsg));\n expect(actual).to.have.string(errorMsg);\n done();\n });\n });\n\n describe(\"flags\", function() {\n it(\"default at 0\", function(done) {\n const actual = new HTTPError(errorMsg);\n expect(actual.flags).to.equal(0);\n done();\n });\n\n it(\"can be quiet\", function(done) {\n const actual = new HTTPError(errorMsg, undefined, undefined, undefined, undefined, HTTPError.FLAGS.QUIET);\n expect(actual.isQuiet()).to.equal(true);\n expect(actual.flags).to.equal(HTTPError.FLAGS.QUIET);\n done();\n });\n\n it(\"can be extended\", function(done) {\n const actual =\n // eslint-disable-next-line no-bitwise\n new HTTPError(errorMsg, undefined, undefined, undefined, undefined, HTTPError.FLAGS.QUIET | 4);\n expect(actual.isQuiet()).to.equal(true);\n // eslint-disable-next-line no-bitwise\n expect(actual.flags).to.equal(HTTPError.FLAGS.QUIET | 4);\n done();\n });\n });\n});\n"]}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- /* eslint-disable no-bitwise */
8
- /* globals assert */
9
- /**
10
- * @fileoverview Tests the functions exported by error_objects/http_error_no_stack.js
11
- */
12
- const chai_1 = require("chai");
13
- const index_1 = require("../../index");
14
- describe("property-common.HTTPErrorNoStack", function () {
15
- const errorMsg = "a test error message";
16
- describe("object", function () {
17
- it("is instanceof Error", function (done) {
18
- chai_1.expect(new index_1.HTTPErrorNoStack() instanceof Error).to.equal(true);
19
- done();
20
- });
21
- it("is instanceof HTTPError", function (done) {
22
- chai_1.expect(new index_1.HTTPErrorNoStack() instanceof index_1.HTTPError).to.equal(true);
23
- done();
24
- });
25
- it("is instanceof HTTPErrorNoStack", function (done) {
26
- chai_1.expect(new index_1.HTTPErrorNoStack() instanceof index_1.HTTPErrorNoStack).to.equal(true);
27
- done();
28
- });
29
- it("has no stack parameter", function (done) {
30
- const httpErrorNoStack = new index_1.HTTPErrorNoStack(errorMsg);
31
- chai_1.expect(httpErrorNoStack.stack).to.equal(undefined);
32
- done();
33
- });
34
- });
35
- describe("flags", function () {
36
- it("default at 0", function (done) {
37
- const actual = new index_1.HTTPErrorNoStack(errorMsg);
38
- chai_1.expect(actual.flags).to.equal(0);
39
- done();
40
- });
41
- it("can be quiet", function (done) {
42
- const actual = new index_1.HTTPErrorNoStack(errorMsg, undefined, undefined, undefined, undefined, index_1.HTTPErrorNoStack.FLAGS.QUIET);
43
- chai_1.expect(actual.isQuiet()).to.equal(true);
44
- chai_1.expect(actual.flags).to.equal(index_1.HTTPErrorNoStack.FLAGS.QUIET);
45
- done();
46
- });
47
- it("can be extended", function (done) {
48
- const actual = new index_1.HTTPErrorNoStack(errorMsg, undefined, undefined, undefined, undefined, index_1.HTTPErrorNoStack.FLAGS.QUIET | 4);
49
- chai_1.expect(actual.isQuiet()).to.equal(true);
50
- chai_1.expect(actual.flags).to.equal(index_1.HTTPErrorNoStack.FLAGS.QUIET | 4);
51
- done();
52
- });
53
- });
54
- });
55
- //# sourceMappingURL=httpErrorNoStack.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpErrorNoStack.spec.js","sourceRoot":"","sources":["../../../src/test/error_objects/httpErrorNoStack.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,+BAA+B;AAC/B,oBAAoB;AACpB;;GAEG;AAEH,+BAA8B;AAC9B,uCAA0D;AAE1D,QAAQ,CAAC,kCAAkC,EAAE;IACzC,MAAM,QAAQ,G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AAI;YAC5B,MAAM,MAAM,GAAG,IAAI,wBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EACpF,wBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAClC,aAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,wBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC5D,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iBAAiB,EAAE,UAAS,IAAI;YAC/B,MAAM,MAAM,GAAG,IAAI,wBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EACpF,wBAAgB,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACtC,aAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,wBAAgB,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAChE,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n/* globals assert */\n/**\n * @fileoverview Tests the functions exported by error_objects/http_error_no_stack.js\n */\n\nimport { expect } from \"chai\";\nimport { HTTPError, HTTPErrorNoStack } from \"../../index\";\n\ndescribe(\"property-common.HTTPErrorNoStack\", function() {\n const errorMsg = \"a test error message\";\n\n describe(\"object\", function() {\n it(\"is instanceof Error\", function(done) {\n expect(new HTTPErrorNoStack() instanceof Error).to.equal(true);\n done();\n });\n\n it(\"is instanceof HTTPError\", function(done) {\n expect(new HTTPErrorNoStack() instanceof HTTPError).to.equal(true);\n done();\n });\n\n it(\"is instanceof HTTPErrorNoStack\", function(done) {\n expect(new HTTPErrorNoStack() instanceof HTTPErrorNoStack).to.equal(true);\n done();\n });\n\n it(\"has no stack parameter\", function(done) {\n const httpErrorNoStack = new HTTPErrorNoStack(errorMsg);\n expect(httpErrorNoStack.stack).to.equal(undefined);\n done();\n });\n });\n\n describe(\"flags\", function() {\n it(\"default at 0\", function(done) {\n const actual = new HTTPErrorNoStack(errorMsg);\n expect(actual.flags).to.equal(0);\n done();\n });\n\n it(\"can be quiet\", function(done) {\n const actual = new HTTPErrorNoStack(errorMsg, undefined, undefined, undefined, undefined,\n HTTPErrorNoStack.FLAGS.QUIET);\n expect(actual.isQuiet()).to.equal(true);\n expect(actual.flags).to.equal(HTTPErrorNoStack.FLAGS.QUIET);\n done();\n });\n\n it(\"can be extended\", function(done) {\n const actual = new HTTPErrorNoStack(errorMsg, undefined, undefined, undefined, undefined,\n HTTPErrorNoStack.FLAGS.QUIET | 4);\n expect(actual.isQuiet()).to.equal(true);\n expect(actual.flags).to.equal(HTTPErrorNoStack.FLAGS.QUIET | 4);\n done();\n });\n });\n});\n"]}
@@ -1,132 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- /* eslint-disable no-bitwise */
8
- /**
9
- * @fileoverview Tests the functions exported by error_objects/operation_error.js
10
- */
11
- const chai_1 = require("chai");
12
- const index_1 = require("../../index");
13
- describe("property-common.OperationError", function () {
14
- const errorMsg = "a test error message";
15
- const operation = "TestOperation";
16
- describe("object", function () {
17
- it("is instanceof Error", function (done) {
18
- chai_1.expect(new index_1.OperationError() instanceof Error).to.equal(true);
19
- done();
20
- });
21
- it("is instanceof OperationError", function (done) {
22
- chai_1.expect(new index_1.OperationError() instanceof index_1.OperationError).to.equal(true);
23
- done();
24
- });
25
- it("stringifies", function (done) {
26
- const actual = JSON.stringify(new index_1.OperationError(errorMsg));
27
- const expected = '{"flags":0,"name":"OperationError"}';
28
- chai_1.expect(actual).to.equal(expected);
29
- done();
30
- });
31
- });
32
- describe("toString", function () {
33
- it("basic error message", function (done) {
34
- const expected = `OperationError: ${errorMsg}`;
35
- const actual = new index_1.OperationError(errorMsg).toString();
36
- chai_1.expect(actual).to.not.equal(undefined);
37
- chai_1.expect(actual).to.have.string(expected);
38
- done();
39
- });
40
- it("full OperationError", function (done) {
41
- const code = 99;
42
- const expected = `OperationError[${operation}, ${code}, 1 [TRANSIENT]]: ${errorMsg}`;
43
- const actual = new index_1.OperationError(errorMsg, operation, code, index_1.OperationError.FLAGS.TRANSIENT);
44
- chai_1.expect(actual.toString()).to.have.string(expected);
45
- done();
46
- });
47
- it("partial OperationError", function (done) {
48
- const expected = `OperationError[${operation}]: ${errorMsg}`;
49
- const actual = new index_1.OperationError(errorMsg, operation);
50
- chai_1.expect(actual.toString()).to.have.string(expected);
51
- done();
52
- });
53
- it("code only", function (done) {
54
- const code = 99;
55
- const expected = `OperationError[${code}]: ${errorMsg}`;
56
- const actual = new index_1.OperationError(errorMsg, undefined, code);
57
- chai_1.expect(actual.toString()).to.have.string(expected);
58
- done();
59
- });
60
- it("extended flags", function (done) {
61
- const code = 99;
62
- const expected = `OperationError[${operation}, ${code}, 5 [TRANSIENT]]: ${errorMsg}`;
63
- const actual = new index_1.OperationError(errorMsg, operation, code, index_1.OperationError.FLAGS.TRANSIENT | 4);
64
- chai_1.expect(actual.toString()).to.have.string(expected);
65
- done();
66
- });
67
- });
68
- describe("fields", function () {
69
- it("name", function (done) {
70
- const actual = new index_1.OperationError();
71
- chai_1.expect(actual.name).to.equal("OperationError");
72
- done();
73
- });
74
- it("stack", function (done) {
75
- const actual = new index_1.OperationError();
76
- chai_1.expect(actual).to.have.property("stack");
77
- done();
78
- });
79
- it("operation", function (done) {
80
- const actual = new index_1.OperationError(errorMsg, operation);
81
- chai_1.expect(actual.operation).to.equal(operation);
82
- done();
83
- });
84
- it("statusCode", function (done) {
85
- const code = 99;
86
- const actual = new index_1.OperationError(errorMsg, operation, code);
87
- chai_1.expect(actual.statusCode).to.equal(code);
88
- done();
89
- });
90
- it("can set the stack", function (done) {
91
- const e = new index_1.OperationError();
92
- const e2 = new Error();
93
- e.stack = e2.stack;
94
- done();
95
- });
96
- });
97
- describe("flags", function () {
98
- it("default at 0", function (done) {
99
- const actual = new index_1.OperationError(errorMsg, operation, undefined, undefined);
100
- chai_1.expect(actual.flags).to.equal(0);
101
- done();
102
- });
103
- it("can be transiant", function (done) {
104
- const actual = new index_1.OperationError(errorMsg, operation, undefined, index_1.OperationError.FLAGS.TRANSIENT);
105
- chai_1.expect(actual.isTransient()).to.equal(true);
106
- chai_1.expect(actual.flags).to.equal(index_1.OperationError.FLAGS.TRANSIENT);
107
- done();
108
- });
109
- it("can be quiet", function (done) {
110
- const actual = new index_1.OperationError(errorMsg, operation, undefined, index_1.OperationError.FLAGS.QUIET);
111
- chai_1.expect(actual.isQuiet()).to.equal(true);
112
- chai_1.expect(actual.flags).to.equal(index_1.OperationError.FLAGS.QUIET);
113
- done();
114
- });
115
- it("can be transient and quiet", function (done) {
116
- const actual = new index_1.OperationError(errorMsg, operation, undefined, index_1.OperationError.FLAGS.TRANSIENT |
117
- index_1.OperationError.FLAGS.QUIET);
118
- chai_1.expect(actual.isTransient()).to.equal(true);
119
- chai_1.expect(actual.isQuiet()).to.equal(true);
120
- chai_1.expect(actual.flags).to.equal(index_1.OperationError.FLAGS.TRANSIENT | index_1.OperationError.FLAGS.QUIET);
121
- done();
122
- });
123
- it("can be extended", function (done) {
124
- const actual = new index_1.OperationError(errorMsg, operation, undefined, index_1.OperationError.FLAGS.TRANSIENT | 4 | index_1.OperationError.FLAGS.QUIET);
125
- chai_1.expect(actual.isTransient()).to.equal(true);
126
- chai_1.expect(actual.isQuiet()).to.equal(true);
127
- chai_1.expect(actual.flags).to.equal(index_1.OperationError.FLAGS.TRANSIENT | 4 | index_1.OperationError.FLAGS.QUIET);
128
- done();
129
- });
130
- });
131
- });
132
- //# sourceMappingURL=operationError.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operationError.spec.js","sourceRoot":"","sources":["../../../src/test/error_objects/operationError.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,+BAA+B;AAE/B;;GAEG;AAEH,+BAA8B;AAC9B,uCAA6C;AAE7C,QAAQ,CAAC,gCAAgC,EAAE;IACvC,MAAM,QAAQ,GAAG,sBAAsB,CAAC;IACxC,MAAM,SAAS,GAAG,eAAe,CAAC;IAElC,QAAQ,CAAC,QAAQ,EAAE;QACf,EAAE,CAAC,qBAAqB,EAAE,UAAS,IAAI;YACnC,aAAM,CAAC,IAAI,sBAAc,EAAE,YAAY,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7D,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8BAA8B,EAAE,UAAS,IAAI;YAC5C,aAAM,CAAC,IAAI,sBAAc,EAAE,YAAY,sBAAc,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACtE,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,aAAa,EAAE,UAAS,IAAI;YAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,sBAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5D,MAAM,QAAQ,GAAG,qCAAqC,CAAC;YACvD,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAClC,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,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,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAc,CAAC,KAAK,CAAC,SAAS,GAAG,sBAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3F,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iBAAiB,EAAE,UAAS,IAAI;YAC/B,MAAM,MAAM,GAAG,IAAI,sBAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAC5D,sBAAc,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,GAAG,sBAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrE,aAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,aAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAc,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,GAAG,sBAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC/F,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\n/**\n * @fileoverview Tests the functions exported by error_objects/operation_error.js\n */\n\nimport { expect } from \"chai\";\nimport { OperationError } from \"../../index\";\n\ndescribe(\"property-common.OperationError\", function() {\n const errorMsg = \"a test error message\";\n const operation = \"TestOperation\";\n\n describe(\"object\", function() {\n it(\"is instanceof Error\", function(done) {\n expect(new OperationError() instanceof Error).to.equal(true);\n done();\n });\n\n it(\"is instanceof OperationError\", function(done) {\n expect(new OperationError() instanceof OperationError).to.equal(true);\n done();\n });\n\n it(\"stringifies\", function(done) {\n const actual = JSON.stringify(new OperationError(errorMsg));\n const expected = '{\"flags\":0,\"name\":\"OperationError\"}';\n expect(actual).to.equal(expected);\n done();\n });\n });\n\n describe(\"toString\", function() {\n it(\"basic error message\", function(done) {\n const expected = `OperationError: ${errorMsg}`;\n const actual = new OperationError(errorMsg).toString();\n expect(actual).to.not.equal(undefined);\n expect(actual).to.have.string(expected);\n done();\n });\n\n it(\"full OperationError\", function(done) {\n const code = 99;\n const expected = `OperationError[${operation}, ${code}, 1 [TRANSIENT]]: ${errorMsg}`;\n const actual = new OperationError(errorMsg, operation, code, OperationError.FLAGS.TRANSIENT);\n expect(actual.toString()).to.have.string(expected);\n done();\n });\n\n it(\"partial OperationError\", function(done) {\n const expected = `OperationError[${operation}]: ${errorMsg}`;\n const actual = new OperationError(errorMsg, operation);\n expect(actual.toString()).to.have.string(expected);\n done();\n });\n\n it(\"code only\", function(done) {\n const code = 99;\n const expected = `OperationError[${code}]: ${errorMsg}`;\n const actual = new OperationError(errorMsg, undefined, code);\n expect(actual.toString()).to.have.string(expected);\n done();\n });\n\n it(\"extended flags\", function(done) {\n const code = 99;\n const expected = `OperationError[${operation}, ${code}, 5 [TRANSIENT]]: ${errorMsg}`;\n const actual = new OperationError(errorMsg, operation, code, OperationError.FLAGS.TRANSIENT | 4);\n expect(actual.toString()).to.have.string(expected);\n done();\n });\n });\n\n describe(\"fields\", function() {\n it(\"name\", function(done) {\n const actual = new OperationError();\n expect(actual.name).to.equal(\"OperationError\");\n done();\n });\n\n it(\"stack\", function(done) {\n const actual = new OperationError();\n expect(actual).to.have.property(\"stack\");\n done();\n });\n\n it(\"operation\", function(done) {\n const actual = new OperationError(errorMsg, operation);\n expect(actual.operation).to.equal(operation);\n done();\n });\n\n it(\"statusCode\", function(done) {\n const code = 99;\n const actual = new OperationError(errorMsg, operation, code);\n expect(actual.statusCode).to.equal(code);\n done();\n });\n\n it(\"can set the stack\", function(done) {\n const e = new OperationError();\n const e2 = new Error();\n e.stack = e2.stack;\n done();\n });\n });\n\n describe(\"flags\", function() {\n it(\"default at 0\", function(done) {\n const actual = new OperationError(errorMsg, operation, undefined, undefined);\n expect(actual.flags).to.equal(0);\n done();\n });\n\n it(\"can be transiant\", function(done) {\n const actual = new OperationError(errorMsg, operation, undefined, OperationError.FLAGS.TRANSIENT);\n expect(actual.isTransient()).to.equal(true);\n expect(actual.flags).to.equal(OperationError.FLAGS.TRANSIENT);\n done();\n });\n\n it(\"can be quiet\", function(done) {\n const actual = new OperationError(errorMsg, operation, undefined, OperationError.FLAGS.QUIET);\n expect(actual.isQuiet()).to.equal(true);\n expect(actual.flags).to.equal(OperationError.FLAGS.QUIET);\n done();\n });\n\n it(\"can be transient and quiet\", function(done) {\n const actual = new OperationError(errorMsg, operation, undefined, OperationError.FLAGS.TRANSIENT |\n OperationError.FLAGS.QUIET);\n expect(actual.isTransient()).to.equal(true);\n expect(actual.isQuiet()).to.equal(true);\n expect(actual.flags).to.equal(OperationError.FLAGS.TRANSIENT | OperationError.FLAGS.QUIET);\n done();\n });\n\n it(\"can be extended\", function(done) {\n const actual = new OperationError(errorMsg, operation, undefined,\n OperationError.FLAGS.TRANSIENT | 4 | OperationError.FLAGS.QUIET);\n expect(actual.isTransient()).to.equal(true);\n expect(actual.isQuiet()).to.equal(true);\n expect(actual.flags).to.equal(OperationError.FLAGS.TRANSIENT | 4 | OperationError.FLAGS.QUIET);\n done();\n });\n });\n});\n"]}