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.
- package/.editorconfig +24 -0
- package/README.md +27 -269
- package/SECURITY.md +11 -0
- package/cli.ts +2 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/src/Assertions/Contains.d.ts +16 -1
- package/dist/src/Assertions/Contains.d.ts.map +1 -1
- package/dist/src/Assertions/Contains.js +15 -0
- package/dist/src/Assertions/Contains.js.map +1 -1
- package/dist/src/Assertions/Count.d.ts +16 -1
- package/dist/src/Assertions/Count.d.ts.map +1 -1
- package/dist/src/Assertions/Count.js +15 -0
- package/dist/src/Assertions/Count.js.map +1 -1
- package/dist/src/Assertions/Defined.d.ts +15 -1
- package/dist/src/Assertions/Defined.d.ts.map +1 -1
- package/dist/src/Assertions/Defined.js +17 -3
- package/dist/src/Assertions/Defined.js.map +1 -1
- package/dist/src/Assertions/DoesNotContain.d.ts +17 -0
- package/dist/src/Assertions/DoesNotContain.d.ts.map +1 -0
- package/dist/src/Assertions/DoesNotContain.js +30 -0
- package/dist/src/Assertions/DoesNotContain.js.map +1 -0
- package/dist/src/Assertions/DoesNotThrow.d.ts +14 -0
- package/dist/src/Assertions/DoesNotThrow.d.ts.map +1 -1
- package/dist/src/Assertions/DoesNotThrow.js +15 -0
- package/dist/src/Assertions/DoesNotThrow.js.map +1 -1
- package/dist/src/Assertions/Empty.d.ts +15 -1
- package/dist/src/Assertions/Empty.d.ts.map +1 -1
- package/dist/src/Assertions/Empty.js +17 -3
- package/dist/src/Assertions/Empty.js.map +1 -1
- package/dist/src/Assertions/Equal.d.ts +15 -0
- package/dist/src/Assertions/Equal.d.ts.map +1 -1
- package/dist/src/Assertions/Equal.js +16 -1
- package/dist/src/Assertions/Equal.js.map +1 -1
- package/dist/src/Assertions/False.d.ts +15 -1
- package/dist/src/Assertions/False.d.ts.map +1 -1
- package/dist/src/Assertions/False.js +17 -3
- package/dist/src/Assertions/False.js.map +1 -1
- package/dist/src/Assertions/InstanceOf.d.ts +16 -1
- package/dist/src/Assertions/InstanceOf.d.ts.map +1 -1
- package/dist/src/Assertions/InstanceOf.js +19 -4
- package/dist/src/Assertions/InstanceOf.js.map +1 -1
- package/dist/src/Assertions/NotEmpty.d.ts +15 -1
- package/dist/src/Assertions/NotEmpty.d.ts.map +1 -1
- package/dist/src/Assertions/NotEmpty.js +17 -3
- package/dist/src/Assertions/NotEmpty.js.map +1 -1
- package/dist/src/Assertions/NotEqual.d.ts +15 -0
- package/dist/src/Assertions/NotEqual.d.ts.map +1 -1
- package/dist/src/Assertions/NotEqual.js +20 -1
- package/dist/src/Assertions/NotEqual.js.map +1 -1
- package/dist/src/Assertions/NotNull.d.ts +15 -1
- package/dist/src/Assertions/NotNull.d.ts.map +1 -1
- package/dist/src/Assertions/NotNull.js +17 -3
- package/dist/src/Assertions/NotNull.js.map +1 -1
- package/dist/src/Assertions/Null.d.ts +15 -1
- package/dist/src/Assertions/Null.d.ts.map +1 -1
- package/dist/src/Assertions/Null.js +17 -3
- package/dist/src/Assertions/Null.js.map +1 -1
- package/dist/src/Assertions/StringContains.d.ts +15 -0
- package/dist/src/Assertions/StringContains.d.ts.map +1 -1
- package/dist/src/Assertions/StringContains.js +16 -1
- package/dist/src/Assertions/StringContains.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotContain.d.ts +17 -0
- package/dist/src/Assertions/StringDoesNotContain.d.ts.map +1 -0
- package/dist/src/Assertions/StringDoesNotContain.js +30 -0
- package/dist/src/Assertions/StringDoesNotContain.js.map +1 -0
- package/dist/src/Assertions/StringDoesNotEndWith.d.ts +17 -0
- package/dist/src/Assertions/StringDoesNotEndWith.d.ts.map +1 -0
- package/dist/src/Assertions/StringDoesNotEndWith.js +32 -0
- package/dist/src/Assertions/StringDoesNotEndWith.js.map +1 -0
- package/dist/src/Assertions/StringDoesNotStartWith.d.ts +17 -0
- package/dist/src/Assertions/StringDoesNotStartWith.d.ts.map +1 -0
- package/dist/src/Assertions/StringDoesNotStartWith.js +30 -0
- package/dist/src/Assertions/StringDoesNotStartWith.js.map +1 -0
- package/dist/src/Assertions/StringEndsWith.d.ts +15 -0
- package/dist/src/Assertions/StringEndsWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringEndsWith.js +18 -1
- package/dist/src/Assertions/StringEndsWith.js.map +1 -1
- package/dist/src/Assertions/StringStartsWith.d.ts +15 -0
- package/dist/src/Assertions/StringStartsWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringStartsWith.js +15 -0
- package/dist/src/Assertions/StringStartsWith.js.map +1 -1
- package/dist/src/Assertions/Throws.d.ts +14 -0
- package/dist/src/Assertions/Throws.d.ts.map +1 -1
- package/dist/src/Assertions/Throws.js +14 -0
- package/dist/src/Assertions/Throws.js.map +1 -1
- package/dist/src/Assertions/True.d.ts +15 -1
- package/dist/src/Assertions/True.d.ts.map +1 -1
- package/dist/src/Assertions/True.js +17 -3
- package/dist/src/Assertions/True.js.map +1 -1
- package/dist/src/Assertions/Undefined.d.ts +15 -1
- package/dist/src/Assertions/Undefined.d.ts.map +1 -1
- package/dist/src/Assertions/Undefined.js +17 -3
- package/dist/src/Assertions/Undefined.js.map +1 -1
- package/dist/src/Assertions/index.d.ts +4 -4
- package/dist/src/Assertions/index.d.ts.map +1 -1
- package/dist/src/Assertions/index.js +8 -8
- package/dist/src/Assertions/index.js.map +1 -1
- package/dist/src/CLI.d.ts +4 -1
- package/dist/src/CLI.d.ts.map +1 -1
- package/dist/src/CLI.js +9 -7
- package/dist/src/CLI.js.map +1 -1
- package/dist/src/Factory.d.ts +3 -2
- package/dist/src/Factory.d.ts.map +1 -1
- package/dist/src/Factory.js +4 -4
- package/dist/src/Factory.js.map +1 -1
- package/dist/src/Framework/Test.d.ts +14 -0
- package/dist/src/Framework/Test.d.ts.map +1 -1
- package/dist/src/Framework/Test.js +14 -0
- package/dist/src/Framework/Test.js.map +1 -1
- package/dist/src/Framework/TestSuite.d.ts +13 -4
- package/dist/src/Framework/TestSuite.d.ts.map +1 -1
- package/dist/src/Framework/TestSuite.js +9 -0
- package/dist/src/Framework/TestSuite.js.map +1 -1
- package/dist/src/Reporters/JUnitReporter.js +1 -1
- package/dist/src/Reporters/JUnitReporter.js.map +1 -1
- package/dist/src/Reporters/SonarReporter.d.ts.map +1 -1
- package/dist/src/Reporters/SonarReporter.js +3 -2
- package/dist/src/Reporters/SonarReporter.js.map +1 -1
- package/dist/src/Runners/Runner.d.ts +1 -1
- package/dist/src/Runners/Runner.d.ts.map +1 -1
- package/dist/src/Runners/Runner.js.map +1 -1
- package/dist/src/Runners/TestRunner.d.ts +1 -1
- package/dist/src/Runners/TestRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestRunner.js +6 -5
- package/dist/src/Runners/TestRunner.js.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.d.ts +1 -1
- package/dist/src/Runners/TestSuiteRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.js.map +1 -1
- package/icon.svg +83 -0
- package/logo.svg +154 -0
- package/package.json +15 -9
- package/sonar-project.properties +1 -1
- package/src/Assertions/Contains.ts +16 -1
- package/src/Assertions/Count.ts +16 -1
- package/src/Assertions/Defined.ts +17 -3
- package/src/Assertions/DoesNotContain.ts +28 -0
- package/src/Assertions/DoesNotThrow.ts +15 -0
- package/src/Assertions/Empty.ts +17 -3
- package/src/Assertions/Equal.ts +15 -0
- package/src/Assertions/False.ts +17 -3
- package/src/Assertions/InstanceOf.ts +19 -4
- package/src/Assertions/NotEmpty.ts +17 -3
- package/src/Assertions/NotEqual.ts +17 -1
- package/src/Assertions/NotNull.ts +17 -3
- package/src/Assertions/Null.ts +17 -3
- package/src/Assertions/StringContains.ts +17 -2
- package/src/Assertions/StringDoesNotContain.ts +28 -0
- package/src/Assertions/StringDoesNotEndWith.ts +30 -0
- package/src/Assertions/StringDoesNotStartWith.ts +28 -0
- package/src/Assertions/StringEndsWith.ts +19 -2
- package/src/Assertions/StringStartsWith.ts +15 -0
- package/src/Assertions/Throws.ts +14 -0
- package/src/Assertions/True.ts +17 -3
- package/src/Assertions/Undefined.ts +17 -3
- package/src/Assertions/index.ts +4 -4
- package/src/CLI.ts +6 -5
- package/src/Factory.ts +6 -6
- package/src/Framework/Test.ts +14 -0
- package/src/Framework/TestSuite.ts +9 -0
- package/src/Reporters/SonarReporter.ts +2 -1
- package/src/Runners/Runner.ts +1 -1
- package/src/Runners/TestRunner.ts +7 -6
- package/src/Runners/TestSuiteRunner.ts +1 -1
- package/tsconfig.json +4 -2
- package/dist/src/Assertions/NotContains.d.ts +0 -2
- package/dist/src/Assertions/NotContains.d.ts.map +0 -1
- package/dist/src/Assertions/NotContains.js +0 -15
- package/dist/src/Assertions/NotContains.js.map +0 -1
- package/dist/src/Assertions/StringNotContains.d.ts +0 -2
- package/dist/src/Assertions/StringNotContains.d.ts.map +0 -1
- package/dist/src/Assertions/StringNotContains.js +0 -15
- package/dist/src/Assertions/StringNotContains.js.map +0 -1
- package/dist/src/Assertions/StringNotEndsWith.d.ts +0 -2
- package/dist/src/Assertions/StringNotEndsWith.d.ts.map +0 -1
- package/dist/src/Assertions/StringNotEndsWith.js +0 -15
- package/dist/src/Assertions/StringNotEndsWith.js.map +0 -1
- package/dist/src/Assertions/StringNotStartsWith.d.ts +0 -2
- package/dist/src/Assertions/StringNotStartsWith.d.ts.map +0 -1
- package/dist/src/Assertions/StringNotStartsWith.js +0 -15
- package/dist/src/Assertions/StringNotStartsWith.js.map +0 -1
- package/src/Assertions/NotContains.ts +0 -13
- package/src/Assertions/StringNotContains.ts +0 -13
- package/src/Assertions/StringNotEndsWith.ts +0 -13
- package/src/Assertions/StringNotStartsWith.ts +0 -13
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that a string does not end with a given substring
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Passes if the final characters of `haystack` do not match `needle`
|
|
6
|
+
*
|
|
7
|
+
* Fails if the final characters of `haystack` match `needle`
|
|
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.stringDoesNotEndWith(needle, haystack);
|
|
15
|
+
*/
|
|
16
|
+
export default function StringDoesNotEndWith(needle: string, haystack: string | null, message?: string): void;
|
|
17
|
+
//# sourceMappingURL=StringDoesNotEndWith.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringDoesNotEndWith.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringDoesNotEndWith.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,QAYrG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const assert_1 = require("assert");
|
|
4
|
+
/**
|
|
5
|
+
* Asserts that a string does not end with a given substring
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Passes if the final characters of `haystack` do not match `needle`
|
|
9
|
+
*
|
|
10
|
+
* Fails if the final characters of `haystack` match `needle`
|
|
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.stringDoesNotEndWith(needle, haystack);
|
|
18
|
+
*/
|
|
19
|
+
function StringDoesNotEndWith(needle, haystack, message) {
|
|
20
|
+
if (haystack === undefined || haystack === null
|
|
21
|
+
|| haystack.indexOf(needle) === -1
|
|
22
|
+
|| haystack.indexOf(needle) !== haystack.length - needle.length) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
throw new assert_1.AssertionError({
|
|
26
|
+
message: message || 'Expected string containing expression, but string did not contain expression',
|
|
27
|
+
expected: needle,
|
|
28
|
+
actual: haystack
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.default = StringDoesNotEndWith;
|
|
32
|
+
//# sourceMappingURL=StringDoesNotEndWith.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringDoesNotEndWith.js","sourceRoot":"","sources":["../../../src/Assertions/StringDoesNotEndWith.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,oBAAoB,CAAC,MAAc,EAAE,QAAuB,EAAE,OAAgB;IAClG,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI;WACxC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;WAC/B,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;QACjE,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;AAZD,uCAYC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that a string does not begin with a given substring
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Passes if the first characters of `haystack` do not match `needle`
|
|
6
|
+
*
|
|
7
|
+
* Fails if the first characters of `haystack` match `needle`
|
|
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.stringDoesNotStartWith(needle, haystack);
|
|
15
|
+
*/
|
|
16
|
+
export default function StringDoesNotStartWith(needle: string, haystack: string | null, message?: string): void;
|
|
17
|
+
//# sourceMappingURL=StringDoesNotStartWith.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringDoesNotStartWith.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringDoesNotStartWith.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,QAUrG"}
|
|
@@ -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 begin with a given substring
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Passes if the first characters of `haystack` do not match `needle`
|
|
9
|
+
*
|
|
10
|
+
* Fails if the first characters of `haystack` match `needle`
|
|
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.stringDoesNotStartWith(needle, haystack);
|
|
18
|
+
*/
|
|
19
|
+
function StringDoesNotStartWith(needle, haystack, message) {
|
|
20
|
+
if (haystack === undefined || haystack === null || haystack.indexOf(needle) !== 0) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
throw new assert_1.AssertionError({
|
|
24
|
+
message: message || 'Expected string containing expression, but string did not contain expression',
|
|
25
|
+
expected: needle,
|
|
26
|
+
actual: haystack
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.default = StringDoesNotStartWith;
|
|
30
|
+
//# sourceMappingURL=StringDoesNotStartWith.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringDoesNotStartWith.js","sourceRoot":"","sources":["../../../src/Assertions/StringDoesNotStartWith.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,sBAAsB,CAAC,MAAc,EAAE,QAAqB,EAAE,OAAgB;IAClG,IAAG,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,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,yCAUC"}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that a string ends with a given substring
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Passes if the final characters of `haystack` match `needle`
|
|
6
|
+
*
|
|
7
|
+
* Fails if the final characters of `haystack` do not match `needle`
|
|
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.stringEndsWith(needle, haystack);
|
|
15
|
+
*/
|
|
1
16
|
export default function StringEndsWith(needle: string, haystack: string | null, message?: string): void;
|
|
2
17
|
//# sourceMappingURL=StringEndsWith.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringEndsWith.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringEndsWith.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StringEndsWith.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringEndsWith.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,QAY/F"}
|
|
@@ -1,8 +1,25 @@
|
|
|
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 ends with a given substring
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Passes if the final characters of `haystack` match `needle`
|
|
9
|
+
*
|
|
10
|
+
* Fails if the final characters of `haystack` do not match `needle`
|
|
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.stringEndsWith(needle, haystack);
|
|
18
|
+
*/
|
|
4
19
|
function StringEndsWith(needle, haystack, message) {
|
|
5
|
-
if (haystack !== undefined && haystack !== null
|
|
20
|
+
if (haystack !== undefined && haystack !== null
|
|
21
|
+
&& haystack.indexOf(needle) > -1
|
|
22
|
+
&& haystack.indexOf(needle) === haystack.length - needle.length) {
|
|
6
23
|
return;
|
|
7
24
|
}
|
|
8
25
|
throw new assert_1.AssertionError({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringEndsWith.js","sourceRoot":"","sources":["../../../src/Assertions/StringEndsWith.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,cAAc,CAAC,MAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"StringEndsWith.js","sourceRoot":"","sources":["../../../src/Assertions/StringEndsWith.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;WACxC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;WAC7B,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;QACjE,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;AAZD,iCAYC"}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that a string begins with a given substring
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Passes if the first characters of `haystack` match `needle`
|
|
6
|
+
*
|
|
7
|
+
* Fails if the first characters of `haystack` do not match `needle`
|
|
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.stringStartsWith(needle, haystack);
|
|
15
|
+
*/
|
|
1
16
|
export default function StringStartsWith(needle: string, haystack: string | null, message?: string): void;
|
|
2
17
|
//# sourceMappingURL=StringStartsWith.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringStartsWith.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringStartsWith.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,QAU/F"}
|
|
1
|
+
{"version":3,"file":"StringStartsWith.d.ts","sourceRoot":"","sources":["../../../src/Assertions/StringStartsWith.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAC,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,QAU/F"}
|
|
@@ -1,6 +1,21 @@
|
|
|
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 begins with a given substring
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Passes if the first characters of `haystack` match `needle`
|
|
9
|
+
*
|
|
10
|
+
* Fails if the first characters of `haystack` do not match `needle`
|
|
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.stringStartsWith(needle, haystack);
|
|
18
|
+
*/
|
|
4
19
|
function StringStartsWith(needle, haystack, message) {
|
|
5
20
|
if (haystack !== undefined && haystack !== null && haystack.indexOf(needle) === 0) {
|
|
6
21
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringStartsWith.js","sourceRoot":"","sources":["../../../src/Assertions/StringStartsWith.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,gBAAgB,CAAC,MAAc,EAAE,QAAqB,EAAE,OAAgB;IAC5F,IAAG,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,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,mCAUC"}
|
|
1
|
+
{"version":3,"file":"StringStartsWith.js","sourceRoot":"","sources":["../../../src/Assertions/StringStartsWith.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;;GAcG;AACH,SAAwB,gBAAgB,CAAC,MAAc,EAAE,QAAqB,EAAE,OAAgB;IAC5F,IAAG,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,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,mCAUC"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that an expression throws an error/exception
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Passes if calling `expression` throws an error/exception
|
|
6
|
+
*
|
|
7
|
+
* Fails if calling `expression` does not throw an error/exception
|
|
8
|
+
*
|
|
9
|
+
* @param expression the expression to run
|
|
10
|
+
* @param message (optional) message to display on failure
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* this.assert.throws(() => expression);
|
|
14
|
+
*/
|
|
1
15
|
export default function Throws(expression: () => any, message?: string): void;
|
|
2
16
|
//# sourceMappingURL=Throws.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Throws.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Throws.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUrE"}
|
|
1
|
+
{"version":3,"file":"Throws.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Throws.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUrE"}
|
|
@@ -1,6 +1,20 @@
|
|
|
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 throws an error/exception
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Passes if calling `expression` throws an error/exception
|
|
9
|
+
*
|
|
10
|
+
* Fails if calling `expression` does not throw 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.throws(() => expression);
|
|
17
|
+
*/
|
|
4
18
|
function Throws(expression, message) {
|
|
5
19
|
try {
|
|
6
20
|
expression();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Throws.js","sourceRoot":"","sources":["../../../src/Assertions/Throws.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,MAAM,CAAC,UAAqB,EAAE,OAAgB;IAClE,IAAI;QACA,UAAU,EAAE,CAAC;KAChB;IAAC,OAAO,SAAS,EAAE;QAChB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,gFAAgF;KACvG,CAAC,CAAC;AACP,CAAC;AAVD,yBAUC"}
|
|
1
|
+
{"version":3,"file":"Throws.js","sourceRoot":"","sources":["../../../src/Assertions/Throws.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,MAAM,CAAC,UAAqB,EAAE,OAAgB;IAClE,IAAI;QACA,UAAU,EAAE,CAAC;KAChB;IAAC,OAAO,SAAS,EAAE;QAChB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,gFAAgF;KACvG,CAAC,CAAC;AACP,CAAC;AAVD,yBAUC"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that a given expression evaluates to `true`
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Passes if `expression` evaluates to `true`
|
|
6
|
+
*
|
|
7
|
+
* Fails if `expression` does not evaluate to `true`
|
|
8
|
+
*
|
|
9
|
+
* @param expression the value to check
|
|
10
|
+
* @param message (optional) message to display on failure
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* this.assert.true(expression);
|
|
14
|
+
*/
|
|
15
|
+
export default function True(expression: any, message?: string): void;
|
|
2
16
|
//# sourceMappingURL=True.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"True.d.ts","sourceRoot":"","sources":["../../../src/Assertions/True.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"True.d.ts","sourceRoot":"","sources":["../../../src/Assertions/True.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
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Asserts that a given expression evaluates to `true`
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Passes if `expression` evaluates to `true`
|
|
9
|
+
*
|
|
10
|
+
* Fails if `expression` does not evaluate to `true`
|
|
11
|
+
*
|
|
12
|
+
* @param expression the value to check
|
|
13
|
+
* @param message (optional) message to display on failure
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* this.assert.true(expression);
|
|
17
|
+
*/
|
|
18
|
+
function True(expression, message) {
|
|
19
|
+
if (expression === true) {
|
|
6
20
|
return;
|
|
7
21
|
}
|
|
8
22
|
throw new assert_1.AssertionError({
|
|
9
23
|
message: message || 'Expected expression to be true, but expression is not true',
|
|
10
24
|
expected: true,
|
|
11
|
-
actual:
|
|
25
|
+
actual: expression
|
|
12
26
|
});
|
|
13
27
|
}
|
|
14
28
|
exports.default = True;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"True.js","sourceRoot":"","sources":["../../../src/Assertions/True.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"True.js","sourceRoot":"","sources":["../../../src/Assertions/True.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,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that a given value is equal to `undefined`
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Passes if `expression` evaluates to `undefined`
|
|
6
|
+
*
|
|
7
|
+
* Fails if `expression` does not evaluate to `undefined`
|
|
8
|
+
*
|
|
9
|
+
* @param expression the value to check
|
|
10
|
+
* @param message (optional) message to display on failure
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* this.assert.undefined(expression);
|
|
14
|
+
*/
|
|
15
|
+
export default function Undefined(expression: any, message?: string): void;
|
|
2
16
|
//# sourceMappingURL=Undefined.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Undefined.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Undefined.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"Undefined.d.ts","sourceRoot":"","sources":["../../../src/Assertions/Undefined.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,QAUlE"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const assert_1 = require("assert");
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Asserts that a given value is equal to `undefined`
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Passes if `expression` evaluates to `undefined`
|
|
9
|
+
*
|
|
10
|
+
* Fails if `expression` does not evaluate to `undefined`
|
|
11
|
+
*
|
|
12
|
+
* @param expression the value to check
|
|
13
|
+
* @param message (optional) message to display on failure
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* this.assert.undefined(expression);
|
|
17
|
+
*/
|
|
18
|
+
function Undefined(expression, message) {
|
|
19
|
+
if (expression === undefined) {
|
|
6
20
|
return;
|
|
7
21
|
}
|
|
8
22
|
throw new assert_1.AssertionError({
|
|
9
23
|
message: message || 'Expected expression to be undefined, but expression is not undefined',
|
|
10
24
|
expected: undefined,
|
|
11
|
-
actual:
|
|
25
|
+
actual: expression
|
|
12
26
|
});
|
|
13
27
|
}
|
|
14
28
|
exports.default = Undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Undefined.js","sourceRoot":"","sources":["../../../src/Assertions/Undefined.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC,SAAwB,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"Undefined.js","sourceRoot":"","sources":["../../../src/Assertions/Undefined.ts"],"names":[],"mappings":";;AAAA,mCAAwC;AAExC;;;;;;;;;;;;;GAaG;AACH,SAAwB,SAAS,CAAC,UAAe,EAAE,OAAgB;IAC/D,IAAG,UAAU,KAAK,SAAS,EAAE;QACzB,OAAO;KACV;IAED,MAAM,IAAI,uBAAc,CAAC;QACrB,OAAO,EAAE,OAAO,IAAI,sEAAsE;QAC1F,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,UAAU;KACrB,CAAC,CAAC;AACP,CAAC;AAVD,4BAUC"}
|
|
@@ -10,13 +10,13 @@ import empty from './Empty';
|
|
|
10
10
|
import not_empty from './NotEmpty';
|
|
11
11
|
import count from './Count';
|
|
12
12
|
import contains from './Contains';
|
|
13
|
-
import not_contains from './
|
|
13
|
+
import not_contains from './DoesNotContain';
|
|
14
14
|
import string_contains from './StringContains';
|
|
15
|
-
import string_not_contains from './
|
|
15
|
+
import string_not_contains from './StringDoesNotContain';
|
|
16
16
|
import string_starts from './StringStartsWith';
|
|
17
|
-
import string_not_starts from './
|
|
17
|
+
import string_not_starts from './StringDoesNotStartWith';
|
|
18
18
|
import string_ends from './StringEndsWith';
|
|
19
|
-
import string_not_ends from './
|
|
19
|
+
import string_not_ends from './StringDoesNotEndWith';
|
|
20
20
|
import instance_of from './InstanceOf';
|
|
21
21
|
import throws from './Throws';
|
|
22
22
|
import does_not_throw from './DoesNotThrow';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Assertions/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,QAAQ,CAAC;AAC7B,OAAO,QAAQ,MAAM,SAAS,CAAC;AAE/B,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,UAAU,MAAM,WAAW,CAAC;AAEnC,OAAO,OAAO,MAAM,QAAQ,CAAC;AAC7B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,YAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Assertions/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,QAAQ,CAAC;AAC7B,OAAO,QAAQ,MAAM,SAAS,CAAC;AAE/B,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,UAAU,MAAM,WAAW,CAAC;AAEnC,OAAO,OAAO,MAAM,QAAQ,CAAC;AAC7B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AAEzD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,eAAe,MAAM,wBAAwB,CAAC;AAErD,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,cAAc,MAAM,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAE5C,wBAkCC"}
|
|
@@ -15,13 +15,13 @@ const Empty_1 = __importDefault(require("./Empty"));
|
|
|
15
15
|
const NotEmpty_1 = __importDefault(require("./NotEmpty"));
|
|
16
16
|
const Count_1 = __importDefault(require("./Count"));
|
|
17
17
|
const Contains_1 = __importDefault(require("./Contains"));
|
|
18
|
-
const
|
|
18
|
+
const DoesNotContain_1 = __importDefault(require("./DoesNotContain"));
|
|
19
19
|
const StringContains_1 = __importDefault(require("./StringContains"));
|
|
20
|
-
const
|
|
20
|
+
const StringDoesNotContain_1 = __importDefault(require("./StringDoesNotContain"));
|
|
21
21
|
const StringStartsWith_1 = __importDefault(require("./StringStartsWith"));
|
|
22
|
-
const
|
|
22
|
+
const StringDoesNotStartWith_1 = __importDefault(require("./StringDoesNotStartWith"));
|
|
23
23
|
const StringEndsWith_1 = __importDefault(require("./StringEndsWith"));
|
|
24
|
-
const
|
|
24
|
+
const StringDoesNotEndWith_1 = __importDefault(require("./StringDoesNotEndWith"));
|
|
25
25
|
const InstanceOf_1 = __importDefault(require("./InstanceOf"));
|
|
26
26
|
const Throws_1 = __importDefault(require("./Throws"));
|
|
27
27
|
const DoesNotThrow_1 = __importDefault(require("./DoesNotThrow"));
|
|
@@ -39,13 +39,13 @@ exports.default = new class AssertionLibrary {
|
|
|
39
39
|
this.notEmpty = NotEmpty_1.default;
|
|
40
40
|
this.count = Count_1.default;
|
|
41
41
|
this.contains = Contains_1.default;
|
|
42
|
-
this.doesNotContain =
|
|
42
|
+
this.doesNotContain = DoesNotContain_1.default;
|
|
43
43
|
this.stringContains = StringContains_1.default;
|
|
44
|
-
this.stringDoesNotContain =
|
|
44
|
+
this.stringDoesNotContain = StringDoesNotContain_1.default;
|
|
45
45
|
this.stringStartsWith = StringStartsWith_1.default;
|
|
46
|
-
this.stringDoesNotStartWIth =
|
|
46
|
+
this.stringDoesNotStartWIth = StringDoesNotStartWith_1.default;
|
|
47
47
|
this.stringEndsWith = StringEndsWith_1.default;
|
|
48
|
-
this.stringDoesNotEndWith =
|
|
48
|
+
this.stringDoesNotEndWith = StringDoesNotEndWith_1.default;
|
|
49
49
|
this.instanceOf = InstanceOf_1.default;
|
|
50
50
|
this.throws = Throws_1.default;
|
|
51
51
|
this.doesNotThrow = DoesNotThrow_1.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Assertions/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAA6B;AAC7B,oDAA+B;AAE/B,4DAAuC;AACvC,wDAAmC;AAEnC,kDAA6B;AAC7B,wDAAiC;AAEjC,oDAA4B;AAC5B,0DAAmC;AAEnC,oDAA4B;AAC5B,0DAAmC;AAEnC,oDAA4B;AAE5B,0DAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Assertions/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAA6B;AAC7B,oDAA+B;AAE/B,4DAAuC;AACvC,wDAAmC;AAEnC,kDAA6B;AAC7B,wDAAiC;AAEjC,oDAA4B;AAC5B,0DAAmC;AAEnC,oDAA4B;AAC5B,0DAAmC;AAEnC,oDAA4B;AAE5B,0DAAkC;AAClC,sEAA4C;AAE5C,sEAA+C;AAC/C,kFAAyD;AAEzD,0EAA+C;AAC/C,sFAAyD;AAEzD,sEAA2C;AAC3C,kFAAqD;AAErD,8DAAuC;AAEvC,sDAA8B;AAC9B,kEAA4C;AAE5C,kBAAe,IAAI,MAAM,gBAAgB;IAAtB;QACf,SAAI,GAAG,cAAO,CAAC;QACf,UAAK,GAAG,eAAQ,CAAC;QAEjB,cAAS,GAAG,mBAAY,CAAC;QACzB,YAAO,GAAG,iBAAU,CAAC;QAErB,SAAI,GAAG,cAAO,CAAC;QACf,YAAO,GAAG,iBAAQ,CAAC;QAEnB,UAAK,GAAG,eAAK,CAAC;QACd,aAAQ,GAAG,kBAAS,CAAC;QAErB,UAAK,GAAG,eAAK,CAAC;QACd,aAAQ,GAAG,kBAAS,CAAC;QAErB,UAAK,GAAG,eAAK,CAAC;QAEd,aAAQ,GAAG,kBAAQ,CAAC;QACpB,mBAAc,GAAG,wBAAY,CAAC;QAE9B,mBAAc,GAAG,wBAAe,CAAC;QACjC,yBAAoB,GAAG,8BAAmB,CAAC;QAE3C,qBAAgB,GAAG,0BAAa,CAAC;QACjC,2BAAsB,GAAG,gCAAiB,CAAC;QAE3C,mBAAc,GAAG,wBAAW,CAAC;QAC7B,yBAAoB,GAAG,8BAAe,CAAC;QAEvC,eAAU,GAAG,oBAAW,CAAC;QAEzB,WAAM,GAAG,gBAAM,CAAC;QAChB,iBAAY,GAAG,sBAAc,CAAC;IAClC,CAAC;CAAA,CAAA"}
|
package/dist/src/CLI.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import Process from "process";
|
|
3
|
+
import Args from "command-line-args";
|
|
4
|
+
import Runner from "./Runners/Runner";
|
|
3
5
|
export default class CLI {
|
|
6
|
+
private readonly runnerFactory;
|
|
4
7
|
private readonly process;
|
|
5
8
|
private static readonly options;
|
|
6
9
|
private static readonly sections;
|
|
7
10
|
private static readonly usage;
|
|
8
|
-
constructor(process: typeof Process);
|
|
11
|
+
constructor(runnerFactory: (args: Args.CommandLineOptions) => Runner, process: typeof Process);
|
|
9
12
|
run(): Promise<boolean>;
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=CLI.d.ts.map
|
package/dist/src/CLI.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CLI.d.ts","sourceRoot":"","sources":["../../src/CLI.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"CLI.d.ts","sourceRoot":"","sources":["../../src/CLI.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAGtC,MAAM,CAAC,OAAO,OAAO,GAAG;IAkER,OAAO,CAAC,QAAQ,CAAC,aAAa;IAA6C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAjE/G,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAmC7B;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAwB9B;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAuB;gBAEvB,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,KAAK,MAAM,EAAmB,OAAO,EAAE,OAAO,OAAO;IAGzH,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAsBhC"}
|
package/dist/src/CLI.js
CHANGED
|
@@ -15,30 +15,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const command_line_usage_1 = __importDefault(require("command-line-usage"));
|
|
16
16
|
const JUnitReporter_1 = __importDefault(require("./Reporters/JUnitReporter"));
|
|
17
17
|
const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
18
|
-
const Factory_1 = __importDefault(require("./Factory"));
|
|
19
18
|
const Runner_1 = __importDefault(require("./Runners/Runner"));
|
|
20
19
|
const SonarReporter_1 = __importDefault(require("./Reporters/SonarReporter"));
|
|
21
20
|
class CLI {
|
|
22
|
-
constructor(process) {
|
|
21
|
+
constructor(runnerFactory, process) {
|
|
22
|
+
this.runnerFactory = runnerFactory;
|
|
23
23
|
this.process = process;
|
|
24
24
|
}
|
|
25
25
|
run() {
|
|
26
26
|
var _a;
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const args = command_line_args_1.default(CLI.options, { argv: this.process.argv });
|
|
28
|
+
const args = (0, command_line_args_1.default)(CLI.options, { argv: this.process.argv });
|
|
29
29
|
if (args.help) {
|
|
30
30
|
this.process.stdout.write(CLI.usage);
|
|
31
31
|
this.process.stdout.write('\n');
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
|
-
const runner =
|
|
34
|
+
const runner = this.runnerFactory(args);
|
|
35
35
|
try {
|
|
36
36
|
const results = yield runner.runAll(args.dir);
|
|
37
37
|
return Runner_1.default.allTestsPassed(results);
|
|
38
38
|
}
|
|
39
39
|
catch (error) {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (error instanceof Error) {
|
|
41
|
+
this.process.stderr.write(`An unhandled ${error.name} occurred: ${error.message}\n`);
|
|
42
|
+
this.process.stderr.write(((_a = error.stack) === null || _a === void 0 ? void 0 : _a.toString()) || '(no call stack)\n');
|
|
43
|
+
}
|
|
42
44
|
return false;
|
|
43
45
|
}
|
|
44
46
|
});
|
|
@@ -106,5 +108,5 @@ CLI.sections = [
|
|
|
106
108
|
optionList: CLI.options
|
|
107
109
|
}
|
|
108
110
|
];
|
|
109
|
-
CLI.usage = command_line_usage_1.default(CLI.sections);
|
|
111
|
+
CLI.usage = (0, command_line_usage_1.default)(CLI.sections);
|
|
110
112
|
//# sourceMappingURL=CLI.js.map
|
package/dist/src/CLI.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CLI.js","sourceRoot":"","sources":["../../src/CLI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,4EAAuC;AACvC,8EAAsD;AAEtD,0EAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"CLI.js","sourceRoot":"","sources":["../../src/CLI.ts"],"names":[],"mappings":"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"}
|
package/dist/src/Factory.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import Args from 'command-line-args';
|
|
2
|
+
import FileSystem from './IO/FileSystem';
|
|
2
3
|
import ResultReporter from './Reporters/ResultReporter';
|
|
3
4
|
import Runner from './Runners/Runner';
|
|
4
5
|
export default class Factory {
|
|
5
|
-
|
|
6
|
+
static readonly file_system: FileSystem;
|
|
6
7
|
static Runner(args: Args.CommandLineOptions): Runner;
|
|
7
|
-
static Reporters(args: Args.CommandLineOptions): ResultReporter
|
|
8
|
+
static Reporters(args: Args.CommandLineOptions): ReadonlyArray<ResultReporter>;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=Factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.d.ts","sourceRoot":"","sources":["../../src/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Factory.d.ts","sourceRoot":"","sources":["../../src/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAErC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAGzC,OAAO,cAAc,MAAM,4BAA4B,CAAC;AACxD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAOtC,MAAM,CAAC,OAAO,OAAO,OAAO;IACxB,MAAM,CAAC,QAAQ,CAAC,WAAW,aAAsB;IAEjD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB;IAS3C,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC,cAAc,CAAC;CAOjF"}
|
package/dist/src/Factory.js
CHANGED
|
@@ -15,8 +15,8 @@ const promises_1 = __importDefault(require("fs/promises"));
|
|
|
15
15
|
const SonarReporter_1 = __importDefault(require("./Reporters/SonarReporter"));
|
|
16
16
|
class Factory {
|
|
17
17
|
static Runner(args) {
|
|
18
|
-
const loader = new TestSuiteLoader_1.default(
|
|
19
|
-
const reporters =
|
|
18
|
+
const loader = new TestSuiteLoader_1.default(Factory.file_system);
|
|
19
|
+
const reporters = Factory.Reporters(args);
|
|
20
20
|
const test_runner = new TestRunner_1.default(reporters);
|
|
21
21
|
const test_suite_runner = new TestSuiteRunner_1.default(test_runner, reporters);
|
|
22
22
|
return new Runner_1.default(loader, test_suite_runner, reporters);
|
|
@@ -25,8 +25,8 @@ class Factory {
|
|
|
25
25
|
var _a, _b;
|
|
26
26
|
return [
|
|
27
27
|
!args.quiet ? new ConsoleReporter_1.default(new Output_1.default(process.stdout)) : null,
|
|
28
|
-
args.junit !== undefined ? new JUnitReporter_1.default(
|
|
29
|
-
args.sonar !== undefined ? new SonarReporter_1.default(
|
|
28
|
+
args.junit !== undefined ? new JUnitReporter_1.default(Factory.file_system, (_a = args.junit) !== null && _a !== void 0 ? _a : JUnitReporter_1.default.defaultFileName) : null,
|
|
29
|
+
args.sonar !== undefined ? new SonarReporter_1.default(Factory.file_system, (_b = args.sonar) !== null && _b !== void 0 ? _b : SonarReporter_1.default.defaultFileName) : null
|
|
30
30
|
].filter(r => r !== null);
|
|
31
31
|
}
|
|
32
32
|
}
|
package/dist/src/Factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../../src/Factory.ts"],"names":[],"mappings":";;;;;AACA,kFAA0D;AAC1D,iEAAyC;AACzC,8EAAsD;AACtD,yDAAiC;AAEjC,8DAAsC;AACtC,sEAA8C;AAC9C,gFAAwD;AACxD,gFAAwD;AACxD,2DAA6B;AAC7B,8EAAsD;AAEtD,MAAqB,OAAO;IAGxB,MAAM,CAAC,MAAM,CAAC,IAA6B;QACvC,MAAM,MAAM,GAAG,IAAI,yBAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../../src/Factory.ts"],"names":[],"mappings":";;;;;AACA,kFAA0D;AAC1D,iEAAyC;AACzC,8EAAsD;AACtD,yDAAiC;AAEjC,8DAAsC;AACtC,sEAA8C;AAC9C,gFAAwD;AACxD,gFAAwD;AACxD,2DAA6B;AAC7B,8EAAsD;AAEtD,MAAqB,OAAO;IAGxB,MAAM,CAAC,MAAM,CAAC,IAA6B;QACvC,MAAM,MAAM,GAAG,IAAI,yBAAe,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACxD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,WAAW,GAAG,IAAI,oBAAU,CAAC,SAAS,CAAC,CAAC;QAC9C,MAAM,iBAAiB,GAAG,IAAI,yBAAe,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAEtE,OAAO,IAAI,gBAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,IAA6B;;QAC1C,OAAO;YACH,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,yBAAe,CAAC,IAAI,gBAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;YACpE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,uBAAa,CAAC,OAAO,CAAC,WAAW,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,uBAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;YACrH,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,uBAAa,CAAC,OAAO,CAAC,WAAW,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,uBAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;SACxH,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAqB,CAAC;IAClD,CAAC;;AAlBL,0BAmBC;AAlBmB,mBAAW,GAAG,IAAI,oBAAU,CAAC,kBAAE,CAAC,CAAC"}
|