xunit.ts 0.12.0 → 1.0.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 (185) hide show
  1. package/.editorconfig +24 -0
  2. package/README.md +27 -269
  3. package/SECURITY.md +11 -0
  4. package/cli.ts +2 -1
  5. package/dist/cli.js +2 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/src/Assertions/Contains.d.ts +16 -1
  8. package/dist/src/Assertions/Contains.d.ts.map +1 -1
  9. package/dist/src/Assertions/Contains.js +15 -0
  10. package/dist/src/Assertions/Contains.js.map +1 -1
  11. package/dist/src/Assertions/Count.d.ts +16 -1
  12. package/dist/src/Assertions/Count.d.ts.map +1 -1
  13. package/dist/src/Assertions/Count.js +15 -0
  14. package/dist/src/Assertions/Count.js.map +1 -1
  15. package/dist/src/Assertions/Defined.d.ts +15 -1
  16. package/dist/src/Assertions/Defined.d.ts.map +1 -1
  17. package/dist/src/Assertions/Defined.js +17 -3
  18. package/dist/src/Assertions/Defined.js.map +1 -1
  19. package/dist/src/Assertions/DoesNotContain.d.ts +17 -0
  20. package/dist/src/Assertions/DoesNotContain.d.ts.map +1 -0
  21. package/dist/src/Assertions/DoesNotContain.js +30 -0
  22. package/dist/src/Assertions/DoesNotContain.js.map +1 -0
  23. package/dist/src/Assertions/DoesNotThrow.d.ts +14 -0
  24. package/dist/src/Assertions/DoesNotThrow.d.ts.map +1 -1
  25. package/dist/src/Assertions/DoesNotThrow.js +15 -0
  26. package/dist/src/Assertions/DoesNotThrow.js.map +1 -1
  27. package/dist/src/Assertions/Empty.d.ts +15 -1
  28. package/dist/src/Assertions/Empty.d.ts.map +1 -1
  29. package/dist/src/Assertions/Empty.js +17 -3
  30. package/dist/src/Assertions/Empty.js.map +1 -1
  31. package/dist/src/Assertions/Equal.d.ts +15 -0
  32. package/dist/src/Assertions/Equal.d.ts.map +1 -1
  33. package/dist/src/Assertions/Equal.js +16 -1
  34. package/dist/src/Assertions/Equal.js.map +1 -1
  35. package/dist/src/Assertions/False.d.ts +15 -1
  36. package/dist/src/Assertions/False.d.ts.map +1 -1
  37. package/dist/src/Assertions/False.js +17 -3
  38. package/dist/src/Assertions/False.js.map +1 -1
  39. package/dist/src/Assertions/InstanceOf.d.ts +16 -1
  40. package/dist/src/Assertions/InstanceOf.d.ts.map +1 -1
  41. package/dist/src/Assertions/InstanceOf.js +19 -4
  42. package/dist/src/Assertions/InstanceOf.js.map +1 -1
  43. package/dist/src/Assertions/NotEmpty.d.ts +15 -1
  44. package/dist/src/Assertions/NotEmpty.d.ts.map +1 -1
  45. package/dist/src/Assertions/NotEmpty.js +17 -3
  46. package/dist/src/Assertions/NotEmpty.js.map +1 -1
  47. package/dist/src/Assertions/NotEqual.d.ts +15 -0
  48. package/dist/src/Assertions/NotEqual.d.ts.map +1 -1
  49. package/dist/src/Assertions/NotEqual.js +20 -1
  50. package/dist/src/Assertions/NotEqual.js.map +1 -1
  51. package/dist/src/Assertions/NotNull.d.ts +15 -1
  52. package/dist/src/Assertions/NotNull.d.ts.map +1 -1
  53. package/dist/src/Assertions/NotNull.js +17 -3
  54. package/dist/src/Assertions/NotNull.js.map +1 -1
  55. package/dist/src/Assertions/Null.d.ts +15 -1
  56. package/dist/src/Assertions/Null.d.ts.map +1 -1
  57. package/dist/src/Assertions/Null.js +17 -3
  58. package/dist/src/Assertions/Null.js.map +1 -1
  59. package/dist/src/Assertions/StringContains.d.ts +15 -0
  60. package/dist/src/Assertions/StringContains.d.ts.map +1 -1
  61. package/dist/src/Assertions/StringContains.js +16 -1
  62. package/dist/src/Assertions/StringContains.js.map +1 -1
  63. package/dist/src/Assertions/StringDoesNotContain.d.ts +17 -0
  64. package/dist/src/Assertions/StringDoesNotContain.d.ts.map +1 -0
  65. package/dist/src/Assertions/StringDoesNotContain.js +30 -0
  66. package/dist/src/Assertions/StringDoesNotContain.js.map +1 -0
  67. package/dist/src/Assertions/StringDoesNotEndWith.d.ts +17 -0
  68. package/dist/src/Assertions/StringDoesNotEndWith.d.ts.map +1 -0
  69. package/dist/src/Assertions/StringDoesNotEndWith.js +32 -0
  70. package/dist/src/Assertions/StringDoesNotEndWith.js.map +1 -0
  71. package/dist/src/Assertions/StringDoesNotStartWith.d.ts +17 -0
  72. package/dist/src/Assertions/StringDoesNotStartWith.d.ts.map +1 -0
  73. package/dist/src/Assertions/StringDoesNotStartWith.js +30 -0
  74. package/dist/src/Assertions/StringDoesNotStartWith.js.map +1 -0
  75. package/dist/src/Assertions/StringEndsWith.d.ts +15 -0
  76. package/dist/src/Assertions/StringEndsWith.d.ts.map +1 -1
  77. package/dist/src/Assertions/StringEndsWith.js +18 -1
  78. package/dist/src/Assertions/StringEndsWith.js.map +1 -1
  79. package/dist/src/Assertions/StringStartsWith.d.ts +15 -0
  80. package/dist/src/Assertions/StringStartsWith.d.ts.map +1 -1
  81. package/dist/src/Assertions/StringStartsWith.js +15 -0
  82. package/dist/src/Assertions/StringStartsWith.js.map +1 -1
  83. package/dist/src/Assertions/Throws.d.ts +14 -0
  84. package/dist/src/Assertions/Throws.d.ts.map +1 -1
  85. package/dist/src/Assertions/Throws.js +14 -0
  86. package/dist/src/Assertions/Throws.js.map +1 -1
  87. package/dist/src/Assertions/True.d.ts +15 -1
  88. package/dist/src/Assertions/True.d.ts.map +1 -1
  89. package/dist/src/Assertions/True.js +17 -3
  90. package/dist/src/Assertions/True.js.map +1 -1
  91. package/dist/src/Assertions/Undefined.d.ts +15 -1
  92. package/dist/src/Assertions/Undefined.d.ts.map +1 -1
  93. package/dist/src/Assertions/Undefined.js +17 -3
  94. package/dist/src/Assertions/Undefined.js.map +1 -1
  95. package/dist/src/Assertions/index.d.ts +4 -4
  96. package/dist/src/Assertions/index.d.ts.map +1 -1
  97. package/dist/src/Assertions/index.js +8 -8
  98. package/dist/src/Assertions/index.js.map +1 -1
  99. package/dist/src/CLI.d.ts +4 -1
  100. package/dist/src/CLI.d.ts.map +1 -1
  101. package/dist/src/CLI.js +9 -7
  102. package/dist/src/CLI.js.map +1 -1
  103. package/dist/src/Factory.d.ts +3 -2
  104. package/dist/src/Factory.d.ts.map +1 -1
  105. package/dist/src/Factory.js +4 -4
  106. package/dist/src/Factory.js.map +1 -1
  107. package/dist/src/Framework/Test.d.ts +14 -0
  108. package/dist/src/Framework/Test.d.ts.map +1 -1
  109. package/dist/src/Framework/Test.js +14 -0
  110. package/dist/src/Framework/Test.js.map +1 -1
  111. package/dist/src/Framework/TestSuite.d.ts +13 -4
  112. package/dist/src/Framework/TestSuite.d.ts.map +1 -1
  113. package/dist/src/Framework/TestSuite.js +9 -0
  114. package/dist/src/Framework/TestSuite.js.map +1 -1
  115. package/dist/src/Reporters/JUnitReporter.js +1 -1
  116. package/dist/src/Reporters/JUnitReporter.js.map +1 -1
  117. package/dist/src/Reporters/SonarReporter.d.ts.map +1 -1
  118. package/dist/src/Reporters/SonarReporter.js +3 -2
  119. package/dist/src/Reporters/SonarReporter.js.map +1 -1
  120. package/dist/src/Runners/Runner.d.ts +1 -1
  121. package/dist/src/Runners/Runner.d.ts.map +1 -1
  122. package/dist/src/Runners/Runner.js.map +1 -1
  123. package/dist/src/Runners/TestRunner.d.ts +1 -1
  124. package/dist/src/Runners/TestRunner.d.ts.map +1 -1
  125. package/dist/src/Runners/TestRunner.js +6 -5
  126. package/dist/src/Runners/TestRunner.js.map +1 -1
  127. package/dist/src/Runners/TestSuiteRunner.d.ts +1 -1
  128. package/dist/src/Runners/TestSuiteRunner.d.ts.map +1 -1
  129. package/dist/src/Runners/TestSuiteRunner.js.map +1 -1
  130. package/icon.svg +83 -0
  131. package/logo.svg +154 -0
  132. package/package.json +15 -9
  133. package/sonar-project.properties +1 -1
  134. package/src/Assertions/Contains.ts +16 -1
  135. package/src/Assertions/Count.ts +16 -1
  136. package/src/Assertions/Defined.ts +17 -3
  137. package/src/Assertions/DoesNotContain.ts +28 -0
  138. package/src/Assertions/DoesNotThrow.ts +15 -0
  139. package/src/Assertions/Empty.ts +17 -3
  140. package/src/Assertions/Equal.ts +15 -0
  141. package/src/Assertions/False.ts +17 -3
  142. package/src/Assertions/InstanceOf.ts +19 -4
  143. package/src/Assertions/NotEmpty.ts +17 -3
  144. package/src/Assertions/NotEqual.ts +17 -1
  145. package/src/Assertions/NotNull.ts +17 -3
  146. package/src/Assertions/Null.ts +17 -3
  147. package/src/Assertions/StringContains.ts +17 -2
  148. package/src/Assertions/StringDoesNotContain.ts +28 -0
  149. package/src/Assertions/StringDoesNotEndWith.ts +30 -0
  150. package/src/Assertions/StringDoesNotStartWith.ts +28 -0
  151. package/src/Assertions/StringEndsWith.ts +19 -2
  152. package/src/Assertions/StringStartsWith.ts +15 -0
  153. package/src/Assertions/Throws.ts +14 -0
  154. package/src/Assertions/True.ts +17 -3
  155. package/src/Assertions/Undefined.ts +17 -3
  156. package/src/Assertions/index.ts +4 -4
  157. package/src/CLI.ts +6 -5
  158. package/src/Factory.ts +6 -6
  159. package/src/Framework/Test.ts +14 -0
  160. package/src/Framework/TestSuite.ts +9 -0
  161. package/src/Reporters/SonarReporter.ts +2 -1
  162. package/src/Runners/Runner.ts +1 -1
  163. package/src/Runners/TestRunner.ts +7 -6
  164. package/src/Runners/TestSuiteRunner.ts +1 -1
  165. package/tsconfig.json +4 -2
  166. package/dist/src/Assertions/NotContains.d.ts +0 -2
  167. package/dist/src/Assertions/NotContains.d.ts.map +0 -1
  168. package/dist/src/Assertions/NotContains.js +0 -15
  169. package/dist/src/Assertions/NotContains.js.map +0 -1
  170. package/dist/src/Assertions/StringNotContains.d.ts +0 -2
  171. package/dist/src/Assertions/StringNotContains.d.ts.map +0 -1
  172. package/dist/src/Assertions/StringNotContains.js +0 -15
  173. package/dist/src/Assertions/StringNotContains.js.map +0 -1
  174. package/dist/src/Assertions/StringNotEndsWith.d.ts +0 -2
  175. package/dist/src/Assertions/StringNotEndsWith.d.ts.map +0 -1
  176. package/dist/src/Assertions/StringNotEndsWith.js +0 -15
  177. package/dist/src/Assertions/StringNotEndsWith.js.map +0 -1
  178. package/dist/src/Assertions/StringNotStartsWith.d.ts +0 -2
  179. package/dist/src/Assertions/StringNotStartsWith.d.ts.map +0 -1
  180. package/dist/src/Assertions/StringNotStartsWith.js +0 -15
  181. package/dist/src/Assertions/StringNotStartsWith.js.map +0 -1
  182. package/src/Assertions/NotContains.ts +0 -13
  183. package/src/Assertions/StringNotContains.ts +0 -13
  184. package/src/Assertions/StringNotEndsWith.ts +0 -13
  185. package/src/Assertions/StringNotStartsWith.ts +0 -13
@@ -1,9 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
+ /**
5
+ * Asserts that an expression does not throw an error/exception
6
+ *
7
+ * @remarks
8
+ * Passes if calling `expression` does not throw an error/exception
9
+ *
10
+ * Fails if calling `expression` throws an error/exception
11
+ *
12
+ * @param expression the expression to run
13
+ * @param message (optional) message to display on failure
14
+ *
15
+ * @example
16
+ * this.assert.doesNotThrow(() => expression);
17
+ */
4
18
  function DoesNotThrow(expression, message) {
5
19
  try {
6
20
  expression();
21
+ return;
7
22
  }
8
23
  catch (exception) {
9
24
  throw new assert_1.AssertionError({
@@ -1 +1 @@
1
- {"version":3,"file":"DoesNotThrow.js","sourceRoot":"","sources":["../../../src/Assertions/DoesNotThrow.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,YAAY,CAAC,UAAqB,EAAE,OAAgB;IACxE,IAAI;QACA,UAAU,EAAE,CAAC;KAChB;IAAC,OAAO,SAAS,EAAE;QAChB,MAAM,IAAI,uBAAc,CAAC;YACrB,OAAO,EAAE,OAAO,IAAI,gFAAgF;YACpG,QAAQ,EAAE,gBAAgB;YAC1B,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;KACN;AACL,CAAC;AAVD,+BAUC"}
1
+ {"version":3,"file":"DoesNotThrow.js","sourceRoot":"","sources":["../../../src/Assertions/DoesNotThrow.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,YAAY,CAAC,UAAqB,EAAE,OAAgB;IACxE,IAAI;QACA,UAAU,EAAE,CAAC;QACb,OAAO;KACV;IAAC,OAAO,SAAS,EAAE;QAChB,MAAM,IAAI,uBAAc,CAAC;YACrB,OAAO,EAAE,OAAO,IAAI,gFAAgF;YACpG,QAAQ,EAAE,gBAAgB;YAC1B,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;KACN;AACL,CAAC;AAXD,+BAWC"}
@@ -1,2 +1,16 @@
1
- export default function Empty(value: any, message?: string): void;
1
+ /**
2
+ * Asserts that an array is empty
3
+ *
4
+ * @remarks
5
+ * Passes if `array` contains zero elements
6
+ *
7
+ * Fails if `array` contains any elements
8
+ *
9
+ * @param array the array to check
10
+ * @param message (optional) message to display on failure
11
+ *
12
+ * @example
13
+ * this.assert.empty(array);
14
+ */
15
+ export default function Empty(array: ReadonlyArray<any>, message?: string): void;
2
16
  //# sourceMappingURL=Empty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Empty.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Empty.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUzD"}
1
+ {"version":3,"file":"Empty.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Empty.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,QAUxE"}
@@ -1,14 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
- function Empty(value, message) {
5
- if (value.length === 0) {
4
+ /**
5
+ * Asserts that an array is empty
6
+ *
7
+ * @remarks
8
+ * Passes if `array` contains zero elements
9
+ *
10
+ * Fails if `array` contains any elements
11
+ *
12
+ * @param array the array to check
13
+ * @param message (optional) message to display on failure
14
+ *
15
+ * @example
16
+ * this.assert.empty(array);
17
+ */
18
+ function Empty(array, message) {
19
+ if (array.length === 0) {
6
20
  return;
7
21
  }
8
22
  throw new assert_1.AssertionError({
9
23
  message: message || 'Expected expression to be empty, but expression was not empty',
10
24
  expected: [],
11
- actual: value
25
+ actual: array
12
26
  });
13
27
  }
14
28
  exports.default = Empty;
@@ -1 +1 @@
1
- {"version":3,"file":"Empty.js","sourceRoot":"","sources":["../../../src/Assertions/Empty.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,KAAK,CAAC,KAAU,EAAE,OAAgB;IACtD,IAAG,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACnB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,+DAA+D;QACnF,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,KAAK;KAChB,CAAC,CAAA;AACN,CAAC;AAVD,wBAUC"}
1
+ {"version":3,"file":"Empty.js","sourceRoot":"","sources":["../../../src/Assertions/Empty.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,KAAK,CAAC,KAAyB,EAAE,OAAgB;IACrE,IAAG,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACnB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,+DAA+D;QACnF,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,KAAK;KAChB,CAAC,CAAA;AACN,CAAC;AAVD,wBAUC"}
@@ -1,2 +1,17 @@
1
+ /**
2
+ * Asserts that two values are equal
3
+ *
4
+ * @remarks
5
+ * Passes if `actual` and `expected` evaluate to equal values
6
+ *
7
+ * Fails if `actual` and `expected` do not evaluate to equal values
8
+ *
9
+ * @param expected the expected value
10
+ * @param actual the actual value
11
+ * @param message (optional) message to display on failure
12
+ *
13
+ * @example
14
+ * this.assert.equal(expected, actual);
15
+ */
1
16
  export default function Equal(expected: any, actual: any, message?: string): void;
2
17
  //# sourceMappingURL=Equal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Equal.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Equal.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUzE"}
1
+ {"version":3,"file":"Equal.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Equal.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUzE"}
@@ -5,8 +5,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const assert_1 = require("assert");
7
7
  const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
8
+ /**
9
+ * Asserts that two values are equal
10
+ *
11
+ * @remarks
12
+ * Passes if `actual` and `expected` evaluate to equal values
13
+ *
14
+ * Fails if `actual` and `expected` do not evaluate to equal values
15
+ *
16
+ * @param expected the expected value
17
+ * @param actual the actual value
18
+ * @param message (optional) message to display on failure
19
+ *
20
+ * @example
21
+ * this.assert.equal(expected, actual);
22
+ */
8
23
  function Equal(expected, actual, message) {
9
- if (lodash_isequal_1.default(actual, expected)) {
24
+ if ((0, lodash_isequal_1.default)(actual, expected)) {
10
25
  return;
11
26
  }
12
27
  throw new assert_1.AssertionError({
@@ -1 +1 @@
1
- {"version":3,"file":"Equal.js","sourceRoot":"","sources":["../../../src/Assertions/Equal.ts"],"names":[],"mappings":";;;;;AAAA,mCAAwC;AACxC,oEAAmC;AAEnC,SAAwB,KAAK,CAAC,QAAa,EAAE,MAAW,EAAE,OAAgB;IACtE,IAAG,wBAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;QACxB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,iEAAiE;QACrF,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;KACjB,CAAC,CAAC;AACP,CAAC;AAVD,wBAUC"}
1
+ {"version":3,"file":"Equal.js","sourceRoot":"","sources":["../../../src/Assertions/Equal.ts"],"names":[],"mappings":";;;;;AAAA,mCAAwC;AACxC,oEAAmC;AAEnC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,KAAK,CAAC,QAAa,EAAE,MAAW,EAAE,OAAgB;IACtE,IAAG,IAAA,wBAAK,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;QACxB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,iEAAiE;QACrF,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;KACjB,CAAC,CAAC;AACP,CAAC;AAVD,wBAUC"}
@@ -1,2 +1,16 @@
1
- export default function False(value: any, message?: string): void;
1
+ /**
2
+ * Asserts that a given value is equal to `false`
3
+ *
4
+ * @remarks
5
+ * Passes if `expression` evaluates to `false`
6
+ *
7
+ * Fails if `expression` does not evaluate to `false`
8
+ *
9
+ * @param expression the value to check
10
+ * @param message (optional) message to display on failure
11
+ *
12
+ * @example
13
+ * this.assert.false(expression);
14
+ */
15
+ export default function False(expression: any, message?: string): void;
2
16
  //# sourceMappingURL=False.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"False.d.ts","sourceRoot":"","sources":["../../../src/Assertions/False.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUzD"}
1
+ {"version":3,"file":"False.d.ts","sourceRoot":"","sources":["../../../src/Assertions/False.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAU9D"}
@@ -1,14 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
- function False(value, message) {
5
- if (value === false) {
4
+ /**
5
+ * Asserts that a given value is equal to `false`
6
+ *
7
+ * @remarks
8
+ * Passes if `expression` evaluates to `false`
9
+ *
10
+ * Fails if `expression` does not evaluate to `false`
11
+ *
12
+ * @param expression the value to check
13
+ * @param message (optional) message to display on failure
14
+ *
15
+ * @example
16
+ * this.assert.false(expression);
17
+ */
18
+ function False(expression, message) {
19
+ if (expression === false) {
6
20
  return;
7
21
  }
8
22
  throw new assert_1.AssertionError({
9
23
  message: message || 'Expected expression to be false, but expression is not false',
10
24
  expected: false,
11
- actual: value
25
+ actual: expression
12
26
  });
13
27
  }
14
28
  exports.default = False;
@@ -1 +1 @@
1
- {"version":3,"file":"False.js","sourceRoot":"","sources":["../../../src/Assertions/False.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,KAAK,CAAC,KAAU,EAAE,OAAgB;IACtD,IAAG,KAAK,KAAK,KAAK,EAAE;QAChB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,8DAA8D;QAClF,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,KAAK;KAChB,CAAC,CAAC;AACP,CAAC;AAVD,wBAUC"}
1
+ {"version":3,"file":"False.js","sourceRoot":"","sources":["../../../src/Assertions/False.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,KAAK,CAAC,UAAe,EAAE,OAAgB;IAC3D,IAAG,UAAU,KAAK,KAAK,EAAE;QACrB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,8DAA8D;QAClF,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,UAAU;KACrB,CAAC,CAAC;AACP,CAAC;AAVD,wBAUC"}
@@ -1,2 +1,17 @@
1
- export default function InstanceOf<T>(type: any, value: any, message?: string): void;
1
+ /**
2
+ * Asserts that a value is an instance of a certain type
3
+ *
4
+ * @remarks
5
+ * Passes if `object`'s type matches `type`
6
+ *
7
+ * Fails if `object`'s type does not match `type`
8
+ *
9
+ * @param type the expected type of the value
10
+ * @param expression the value to check
11
+ * @param message (optional) message to display on failure
12
+ *
13
+ * @example
14
+ * this.assert.instanceOf(type, object);
15
+ */
16
+ export default function InstanceOf<T>(type: any, expression: any, message?: string): void;
2
17
  //# sourceMappingURL=InstanceOf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InstanceOf.d.ts","sourceRoot":"","sources":["../../../src/Assertions/InstanceOf.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAU5E"}
1
+ {"version":3,"file":"InstanceOf.d.ts","sourceRoot":"","sources":["../../../src/Assertions/InstanceOf.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUjF"}
@@ -1,14 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
- function InstanceOf(type, value, message) {
5
- if (value instanceof type) {
4
+ /**
5
+ * Asserts that a value is an instance of a certain type
6
+ *
7
+ * @remarks
8
+ * Passes if `object`'s type matches `type`
9
+ *
10
+ * Fails if `object`'s type does not match `type`
11
+ *
12
+ * @param type the expected type of the value
13
+ * @param expression the value to check
14
+ * @param message (optional) message to display on failure
15
+ *
16
+ * @example
17
+ * this.assert.instanceOf(type, object);
18
+ */
19
+ function InstanceOf(type, expression, message) {
20
+ if (expression instanceof type) {
6
21
  return;
7
22
  }
8
23
  throw new assert_1.AssertionError({
9
- message: message || `Expected expression of type, but was ${typeof value}`,
24
+ message: message || `Expected expression of type, but was ${typeof expression}`,
10
25
  expected: type,
11
- actual: typeof value
26
+ actual: typeof expression
12
27
  });
13
28
  }
14
29
  exports.default = InstanceOf;
@@ -1 +1 @@
1
- {"version":3,"file":"InstanceOf.js","sourceRoot":"","sources":["../../../src/Assertions/InstanceOf.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,UAAU,CAAI,IAAS,EAAE,KAAU,EAAE,OAAgB;IACzE,IAAI,KAAK,YAAY,IAAI,EAAE;QACvB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,wCAAwC,OAAO,KAAK,EAAE;QAC1E,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,OAAO,KAAK;KACvB,CAAC,CAAA;AACN,CAAC;AAVD,6BAUC"}
1
+ {"version":3,"file":"InstanceOf.js","sourceRoot":"","sources":["../../../src/Assertions/InstanceOf.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,UAAU,CAAI,IAAS,EAAE,UAAe,EAAE,OAAgB;IAC9E,IAAI,UAAU,YAAY,IAAI,EAAE;QAC5B,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,wCAAwC,OAAO,UAAU,EAAE;QAC/E,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,OAAO,UAAU;KAC5B,CAAC,CAAA;AACN,CAAC;AAVD,6BAUC"}
@@ -1,2 +1,16 @@
1
- export default function NotEmpty(value: any, message?: string): void;
1
+ /**
2
+ * Asserts that an array is not empty
3
+ *
4
+ * @remarks
5
+ * Passes if `array` contains any elements
6
+ *
7
+ * Fails if `array` contains zero elements
8
+ *
9
+ * @param array the array to check
10
+ * @param message (optional) message to display on failure
11
+ *
12
+ * @example
13
+ * this.assert.notEmpty(array);
14
+ */
15
+ export default function NotEmpty(array: ReadonlyArray<any>, message?: string): void;
2
16
  //# sourceMappingURL=NotEmpty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotEmpty.d.ts","sourceRoot":"","sources":["../../../src/Assertions/NotEmpty.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAU5D"}
1
+ {"version":3,"file":"NotEmpty.d.ts","sourceRoot":"","sources":["../../../src/Assertions/NotEmpty.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,QAU3E"}
@@ -1,14 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
- function NotEmpty(value, message) {
5
- if (value.length > 0) {
4
+ /**
5
+ * Asserts that an array is not empty
6
+ *
7
+ * @remarks
8
+ * Passes if `array` contains any elements
9
+ *
10
+ * Fails if `array` contains zero elements
11
+ *
12
+ * @param array the array to check
13
+ * @param message (optional) message to display on failure
14
+ *
15
+ * @example
16
+ * this.assert.notEmpty(array);
17
+ */
18
+ function NotEmpty(array, message) {
19
+ if (array.length > 0) {
6
20
  return;
7
21
  }
8
22
  throw new assert_1.AssertionError({
9
23
  message: message || 'Expected expression to be not empty, but expression was empty',
10
24
  expected: '(non-empty expression)',
11
- actual: value
25
+ actual: array
12
26
  });
13
27
  }
14
28
  exports.default = NotEmpty;
@@ -1 +1 @@
1
- {"version":3,"file":"NotEmpty.js","sourceRoot":"","sources":["../../../src/Assertions/NotEmpty.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,QAAQ,CAAC,KAAU,EAAE,OAAgB;IACzD,IAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACjB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,+DAA+D;QACnF,QAAQ,EAAE,wBAAwB;QAClC,MAAM,EAAE,KAAK;KAChB,CAAC,CAAA;AACN,CAAC;AAVD,2BAUC"}
1
+ {"version":3,"file":"NotEmpty.js","sourceRoot":"","sources":["../../../src/Assertions/NotEmpty.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,QAAQ,CAAC,KAAyB,EAAE,OAAgB;IACxE,IAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACjB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,+DAA+D;QACnF,QAAQ,EAAE,wBAAwB;QAClC,MAAM,EAAE,KAAK;KAChB,CAAC,CAAA;AACN,CAAC;AAVD,2BAUC"}
@@ -1,2 +1,17 @@
1
+ /**
2
+ * Asserts that two values are not equal
3
+ *
4
+ * @remarks
5
+ * Passes if `actual` and `expected` do not evaluate to equal values
6
+ *
7
+ * Fails if `actual` and `expected` evaluate to equal values
8
+ *
9
+ * @param expected the expected value
10
+ * @param actual the actual value
11
+ * @param message (optional) message to display on failure
12
+ *
13
+ * @example
14
+ * this.assert.notEqual(expected, actual);
15
+ */
1
16
  export default function NotEqual(expected: any, actual: any, message?: string): void;
2
17
  //# sourceMappingURL=NotEqual.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotEqual.d.ts","sourceRoot":"","sources":["../../../src/Assertions/NotEqual.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAU5E"}
1
+ {"version":3,"file":"NotEqual.d.ts","sourceRoot":"","sources":["../../../src/Assertions/NotEqual.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAU5E"}
@@ -1,8 +1,27 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const assert_1 = require("assert");
7
+ const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
8
+ /**
9
+ * Asserts that two values are not equal
10
+ *
11
+ * @remarks
12
+ * Passes if `actual` and `expected` do not evaluate to equal values
13
+ *
14
+ * Fails if `actual` and `expected` evaluate to equal values
15
+ *
16
+ * @param expected the expected value
17
+ * @param actual the actual value
18
+ * @param message (optional) message to display on failure
19
+ *
20
+ * @example
21
+ * this.assert.notEqual(expected, actual);
22
+ */
4
23
  function NotEqual(expected, actual, message) {
5
- if (actual !== expected) {
24
+ if (!(0, lodash_isequal_1.default)(actual, expected)) {
6
25
  return;
7
26
  }
8
27
  throw new assert_1.AssertionError({
@@ -1 +1 @@
1
- {"version":3,"file":"NotEqual.js","sourceRoot":"","sources":["../../../src/Assertions/NotEqual.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,QAAQ,CAAC,QAAa,EAAE,MAAW,EAAE,OAAgB;IACzE,IAAG,MAAM,KAAK,QAAQ,EAAE;QACpB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,iEAAiE;QACrF,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;KACjB,CAAC,CAAC;AACP,CAAC;AAVD,2BAUC"}
1
+ {"version":3,"file":"NotEqual.js","sourceRoot":"","sources":["../../../src/Assertions/NotEqual.ts"],"names":[],"mappings":";;;;;AAAA,mCAAwC;AACxC,oEAAmC;AAEnC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,QAAQ,CAAC,QAAa,EAAE,MAAW,EAAE,OAAgB;IACzE,IAAG,CAAC,IAAA,wBAAK,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;QACzB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,iEAAiE;QACrF,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;KACjB,CAAC,CAAC;AACP,CAAC;AAVD,2BAUC"}
@@ -1,2 +1,16 @@
1
- export default function NotNull(value: any, message?: string): void;
1
+ /**
2
+ * Asserts that a value is not `null`
3
+ *
4
+ * @remarks
5
+ * Passes if `expression` does not evaluate to `null`
6
+ *
7
+ * Fails if `expression` evaluates to `null`
8
+ *
9
+ * @param expression the value to check
10
+ * @param message (optional) message to display on failure
11
+ *
12
+ * @example
13
+ * this.assert.notNull(expression);
14
+ */
15
+ export default function NotNull(expression: any, message?: string): void;
2
16
  //# sourceMappingURL=NotNull.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotNull.d.ts","sourceRoot":"","sources":["../../../src/Assertions/NotNull.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAU3D"}
1
+ {"version":3,"file":"NotNull.d.ts","sourceRoot":"","sources":["../../../src/Assertions/NotNull.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUhE"}
@@ -1,14 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
- function NotNull(value, message) {
5
- if (value !== null) {
4
+ /**
5
+ * Asserts that a value is not `null`
6
+ *
7
+ * @remarks
8
+ * Passes if `expression` does not evaluate to `null`
9
+ *
10
+ * Fails if `expression` evaluates to `null`
11
+ *
12
+ * @param expression the value to check
13
+ * @param message (optional) message to display on failure
14
+ *
15
+ * @example
16
+ * this.assert.notNull(expression);
17
+ */
18
+ function NotNull(expression, message) {
19
+ if (expression !== null) {
6
20
  return;
7
21
  }
8
22
  throw new assert_1.AssertionError({
9
23
  message: message || 'Expected expression to be not null, but expression is null',
10
24
  expected: '(non-null expression)',
11
- actual: value
25
+ actual: expression
12
26
  });
13
27
  }
14
28
  exports.default = NotNull;
@@ -1 +1 @@
1
- {"version":3,"file":"NotNull.js","sourceRoot":"","sources":["../../../src/Assertions/NotNull.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,OAAO,CAAC,KAAU,EAAE,OAAgB;IACxD,IAAG,KAAK,KAAK,IAAI,EAAE;QACf,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,4DAA4D;QAChF,QAAQ,EAAE,uBAAuB;QACjC,MAAM,EAAE,KAAK;KAChB,CAAC,CAAC;AACP,CAAC;AAVD,0BAUC"}
1
+ {"version":3,"file":"NotNull.js","sourceRoot":"","sources":["../../../src/Assertions/NotNull.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,OAAO,CAAC,UAAe,EAAE,OAAgB;IAC7D,IAAG,UAAU,KAAK,IAAI,EAAE;QACpB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,4DAA4D;QAChF,QAAQ,EAAE,uBAAuB;QACjC,MAAM,EAAE,UAAU;KACrB,CAAC,CAAC;AACP,CAAC;AAVD,0BAUC"}
@@ -1,2 +1,16 @@
1
- export default function Null(value: any, message?: string): void;
1
+ /**
2
+ * Asserts that a value is `null`
3
+ *
4
+ * @remarks
5
+ * Passes if `expression` evaluates to `null`
6
+ *
7
+ * Fails if `expression` does not evaluate to `null`
8
+ *
9
+ * @param expression the value to check
10
+ * @param message (optional) message to display on failure
11
+ *
12
+ * @example
13
+ * this.assert.null(expression);
14
+ */
15
+ export default function Null(expression: any, message?: string): void;
2
16
  //# sourceMappingURL=Null.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Null.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Null.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUxD"}
1
+ {"version":3,"file":"Null.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Null.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAU7D"}
@@ -1,14 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
- function Null(value, message) {
5
- if (value === null) {
4
+ /**
5
+ * Asserts that a value is `null`
6
+ *
7
+ * @remarks
8
+ * Passes if `expression` evaluates to `null`
9
+ *
10
+ * Fails if `expression` does not evaluate to `null`
11
+ *
12
+ * @param expression the value to check
13
+ * @param message (optional) message to display on failure
14
+ *
15
+ * @example
16
+ * this.assert.null(expression);
17
+ */
18
+ function Null(expression, message) {
19
+ if (expression === null) {
6
20
  return;
7
21
  }
8
22
  throw new assert_1.AssertionError({
9
23
  message: message || 'Expected expression to be null, but expression is not null',
10
24
  expected: null,
11
- actual: value
25
+ actual: expression
12
26
  });
13
27
  }
14
28
  exports.default = Null;
@@ -1 +1 @@
1
- {"version":3,"file":"Null.js","sourceRoot":"","sources":["../../../src/Assertions/Null.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,IAAI,CAAC,KAAU,EAAE,OAAgB;IACrD,IAAG,KAAK,KAAK,IAAI,EAAE;QACf,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,4DAA4D;QAChF,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,KAAK;KAChB,CAAC,CAAC;AACP,CAAC;AAVD,uBAUC"}
1
+ {"version":3,"file":"Null.js","sourceRoot":"","sources":["../../../src/Assertions/Null.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,IAAI,CAAC,UAAe,EAAE,OAAgB;IAC1D,IAAG,UAAU,KAAK,IAAI,EAAE;QACpB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,4DAA4D;QAChF,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,UAAU;KACrB,CAAC,CAAC;AACP,CAAC;AAVD,uBAUC"}
@@ -1,2 +1,17 @@
1
+ /**
2
+ * Asserts that a string contains a given substring
3
+ *
4
+ * @remarks
5
+ * Passes if `needle` is a substring of `haystack`
6
+ *
7
+ * Fails if `needle` is not a substring of `haystack`
8
+ *
9
+ * @param needle the substring to find
10
+ * @param haystack the string to search
11
+ * @param message (optional) message to display on failure
12
+ *
13
+ * @example
14
+ * this.assert.stringContains(needle, haystack);
15
+ */
1
16
  export default function StringContains(needle: string, haystack: string | null, message?: string): void;
2
17
  //# sourceMappingURL=StringContains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StringContains.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringContains.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,QAU7F"}
1
+ {"version":3,"file":"StringContains.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringContains.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,QAU/F"}
@@ -1,8 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const assert_1 = require("assert");
4
+ /**
5
+ * Asserts that a string contains a given substring
6
+ *
7
+ * @remarks
8
+ * Passes if `needle` is a substring of `haystack`
9
+ *
10
+ * Fails if `needle` is not a substring of `haystack`
11
+ *
12
+ * @param needle the substring to find
13
+ * @param haystack the string to search
14
+ * @param message (optional) message to display on failure
15
+ *
16
+ * @example
17
+ * this.assert.stringContains(needle, haystack);
18
+ */
4
19
  function StringContains(needle, haystack, message) {
5
- if (haystack !== undefined && haystack !== null && haystack.indexOf(needle) !== -1) {
20
+ if (haystack !== undefined && haystack !== null && haystack.indexOf(needle) > -1) {
6
21
  return;
7
22
  }
8
23
  throw new assert_1.AssertionError({
@@ -1 +1 @@
1
- {"version":3,"file":"StringContains.js","sourceRoot":"","sources":["../../../src/Assertions/StringContains.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,cAAc,CAAC,MAAc,EAAE,QAAqB,EAAE,OAAgB;IAC1F,IAAG,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/E,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,8EAA8E;QAClG,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,QAAQ;KACnB,CAAC,CAAC;AACP,CAAC;AAVD,iCAUC"}
1
+ {"version":3,"file":"StringContains.js","sourceRoot":"","sources":["../../../src/Assertions/StringContains.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,cAAc,CAAC,MAAc,EAAE,QAAuB,EAAE,OAAgB;IAC5F,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE;QAC9E,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,8EAA8E;QAClG,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,QAAQ;KACnB,CAAC,CAAC;AACP,CAAC;AAVD,iCAUC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Asserts that a string does not contain a given substring
3
+ *
4
+ * @remarks
5
+ * Passes if `needle` is not a substring of `haystack`
6
+ *
7
+ * Fails if `needle` is a substring of `haystack`
8
+ *
9
+ * @param needle the substring to find
10
+ * @param haystack the string to search
11
+ * @param message (optional) message to display on failure
12
+ *
13
+ * @example
14
+ * this.assert.stringDoesNotContain(needle, haystack);
15
+ */
16
+ export default function StringDoesNotContain(needle: string, haystack: string | null, message?: string): void;
17
+ //# sourceMappingURL=StringDoesNotContain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StringDoesNotContain.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringDoesNotContain.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,QAUnG"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const assert_1 = require("assert");
4
+ /**
5
+ * Asserts that a string does not contain a given substring
6
+ *
7
+ * @remarks
8
+ * Passes if `needle` is not a substring of `haystack`
9
+ *
10
+ * Fails if `needle` is a substring of `haystack`
11
+ *
12
+ * @param needle the substring to find
13
+ * @param haystack the string to search
14
+ * @param message (optional) message to display on failure
15
+ *
16
+ * @example
17
+ * this.assert.stringDoesNotContain(needle, haystack);
18
+ */
19
+ function StringDoesNotContain(needle, haystack, message) {
20
+ if (haystack === undefined || haystack === null || haystack.indexOf(needle) === -1) {
21
+ return;
22
+ }
23
+ throw new assert_1.AssertionError({
24
+ message: message || 'Expected string not containing expression, but string did contain expression',
25
+ expected: needle,
26
+ actual: haystack
27
+ });
28
+ }
29
+ exports.default = StringDoesNotContain;
30
+ //# sourceMappingURL=StringDoesNotContain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StringDoesNotContain.js","sourceRoot":"","sources":["../../../src/Assertions/StringDoesNotContain.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,oBAAoB,CAAC,MAAc,EAAE,QAAqB,EAAE,OAAgB;IAChG,IAAG,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/E,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,8EAA8E;QAClG,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,QAAQ;KACnB,CAAC,CAAC;AACP,CAAC;AAVD,uCAUC"}