xunit.ts 1.0.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 +2 -1
- 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/Equal.js +1 -1
- package/dist/src/Assertions/Equal.js.map +1 -1
- package/dist/src/Assertions/NotEqual.js +1 -1
- package/dist/src/Assertions/NotEqual.js.map +1 -1
- package/dist/src/Assertions/StringContains.d.ts.map +1 -1
- package/dist/src/Assertions/StringContains.js +1 -1
- package/dist/src/Assertions/StringContains.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.js +3 -1
- package/dist/src/Assertions/StringDoesNotEndWith.js.map +1 -1
- package/dist/src/Assertions/StringEndsWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringEndsWith.js +3 -1
- package/dist/src/Assertions/StringEndsWith.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 +2 -1
- 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/Reporters/JUnitReporter.js +1 -1
- package/dist/src/Reporters/JUnitReporter.js.map +1 -1
- package/dist/src/Reporters/SonarReporter.js +1 -1
- package/dist/src/Reporters/SonarReporter.js.map +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/icon.svg +83 -0
- package/logo.svg +154 -0
- package/package.json +8 -6
- package/src/Assertions/StringContains.ts +2 -2
- package/src/Assertions/StringDoesNotEndWith.ts +4 -2
- package/src/Assertions/StringEndsWith.ts +4 -2
- package/src/CLI.ts +6 -5
- package/src/Factory.ts +5 -5
- package/src/Runners/TestRunner.ts +6 -5
package/.editorconfig
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
indent_style = tab
|
|
6
|
+
trim_trailing_whitespace = true
|
|
7
|
+
insert_final_newline = false
|
|
8
|
+
max_line_length = off
|
|
9
|
+
|
|
10
|
+
[{*.yml,*.yaml}]
|
|
11
|
+
indent_style = space
|
|
12
|
+
indent_size = 2
|
|
13
|
+
|
|
14
|
+
[*.cs]
|
|
15
|
+
csharp_style_expression_bodied_methods = true
|
|
16
|
+
csharp_style_expression_bodied_constructors = true
|
|
17
|
+
csharp_style_expression_bodied_operators = true
|
|
18
|
+
csharp_style_expression_bodied_properties = true
|
|
19
|
+
csharp_style_expression_bodied_indexers = true
|
|
20
|
+
csharp_style_expression_bodied_accessors = true
|
|
21
|
+
csharp_style_expression_bodied_lambdas = true
|
|
22
|
+
csharp_style_expression_bodied_local_functions = true
|
|
23
|
+
csharp_style_namespace_declarations = file_scoped:warning
|
|
24
|
+
dotnet_diagnostic.S101.severity = suggestion
|
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+

|
|
1
2
|
# xunit.ts
|
|
2
3
|
### A TypeScript unit testing framework, following standard xUnit patterns
|
|
3
4
|
|
|
4
|
-
[](https://npmjs.com/package/xunit.ts)
|
|
5
6
|
[](https://github.com/ecoAPM/xunit.ts/actions)
|
|
6
7
|
[](https://sonarcloud.io/dashboard?id=ecoAPM_xunit.ts)
|
|
7
8
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Security updates are generally only applied to the newest release, and backported on an as-needed basis where appropriate.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
Unless a vulnerability is deemed critical or exposes PII, please create an issue in this repository using the "Report a Bug" template.
|
|
10
|
+
|
|
11
|
+
For critical vulnerabilities, or those that expose PII, please email info@ecoAPM.com so that the issue can be fixed confidentially, prior to public disclosure.
|
package/cli.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const process_1 = __importDefault(require("process"));
|
|
8
8
|
const CLI_1 = __importDefault(require("./src/CLI"));
|
|
9
|
-
|
|
9
|
+
const Factory_1 = __importDefault(require("./src/Factory"));
|
|
10
|
+
new CLI_1.default(Factory_1.default.Runner, process_1.default)
|
|
10
11
|
.run()
|
|
11
12
|
.then(success => process_1.default.exit(success ? 0 : 1));
|
|
12
13
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";;;;;;AAEA,sDAA8B;AAC9B,oDAA4B;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";;;;;;AAEA,sDAA8B;AAC9B,oDAA4B;AAC5B,4DAAoC;AAEpC,IAAI,aAAG,CAAC,iBAAO,CAAC,MAAM,EAAE,iBAAO,CAAC;KAC3B,GAAG,EAAE;KACL,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,iBAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -21,7 +21,7 @@ const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
|
|
|
21
21
|
* this.assert.equal(expected, actual);
|
|
22
22
|
*/
|
|
23
23
|
function Equal(expected, actual, message) {
|
|
24
|
-
if (lodash_isequal_1.default(actual, expected)) {
|
|
24
|
+
if ((0, lodash_isequal_1.default)(actual, expected)) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
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;;;;;;;;;;;;;;GAcG;AACH,SAAwB,KAAK,CAAC,QAAa,EAAE,MAAW,EAAE,OAAgB;IACtE,IAAG,wBAAK,
|
|
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"}
|
|
@@ -21,7 +21,7 @@ const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
|
|
|
21
21
|
* this.assert.notEqual(expected, actual);
|
|
22
22
|
*/
|
|
23
23
|
function NotEqual(expected, actual, message) {
|
|
24
|
-
if (!lodash_isequal_1.default(actual, expected)) {
|
|
24
|
+
if (!(0, lodash_isequal_1.default)(actual, expected)) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
throw new assert_1.AssertionError({
|
|
@@ -1 +1 @@
|
|
|
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,wBAAK,
|
|
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 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -17,7 +17,7 @@ const assert_1 = require("assert");
|
|
|
17
17
|
* this.assert.stringContains(needle, haystack);
|
|
18
18
|
*/
|
|
19
19
|
function StringContains(needle, haystack, message) {
|
|
20
|
-
if (haystack !== undefined && haystack !== null && haystack.indexOf(needle)
|
|
20
|
+
if (haystack !== undefined && haystack !== null && haystack.indexOf(needle) > -1) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
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;;;;;;;;;;;;;;GAcG;AACH,SAAwB,cAAc,CAAC,MAAc,EAAE,
|
|
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"}
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -17,7 +17,9 @@ const assert_1 = require("assert");
|
|
|
17
17
|
* this.assert.stringDoesNotEndWith(needle, haystack);
|
|
18
18
|
*/
|
|
19
19
|
function StringDoesNotEndWith(needle, haystack, message) {
|
|
20
|
-
if (haystack === undefined || haystack === null
|
|
20
|
+
if (haystack === undefined || haystack === null
|
|
21
|
+
|| haystack.indexOf(needle) === -1
|
|
22
|
+
|| haystack.indexOf(needle) !== haystack.length - needle.length) {
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
25
|
throw new assert_1.AssertionError({
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -17,7 +17,9 @@ const assert_1 = require("assert");
|
|
|
17
17
|
* this.assert.stringEndsWith(needle, haystack);
|
|
18
18
|
*/
|
|
19
19
|
function StringEndsWith(needle, haystack, message) {
|
|
20
|
-
if (haystack !== undefined && haystack !== null
|
|
20
|
+
if (haystack !== undefined && haystack !== null
|
|
21
|
+
&& haystack.indexOf(needle) > -1
|
|
22
|
+
&& haystack.indexOf(needle) === haystack.length - needle.length) {
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
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;;;;;;;;;;;;;;GAcG;AACH,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"}
|
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":";;;;;;;;;;;;;;AAAA,4EAAuC;AACvC,8EAAsD;AAEtD,0EAAqC;AACrC,8DAAsC;AACtC,8EAAsD;AAEtD,MAAqB,GAAG;IAkEpB,YAA6B,aAAwD,EAAmB,OAAuB;QAAlG,kBAAa,GAAb,aAAa,CAA2C;QAAmB,YAAO,GAAP,OAAO,CAAgB;IAC/H,CAAC;IAEK,GAAG;;;YACL,MAAM,IAAI,GAAG,IAAA,2BAAI,EAAC,GAAG,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAC,CA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I,EAAE,MAAM;QACZ,SAAS,EAAE,eAAe,uBAAa,CAAC,eAAe,GAAG;QAC1D,WAAW,EAAE,oDAAoD;KACpE;IACD;QACI,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,qCAAqC;KACrD;IACD;QACI,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,uDAAuD;KACvE;CACJ,CAAC;AAEsB,YAAQ,GAAoB;IAChD;QACI,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,wEAAwE;KACpF;IACD;QACI,MAAM,EAAE,OAAO;QACf,OAAO,EAAE;YACL,wEAAwE;YACxE,qCAAqC;SACxC;KACJ;IACD;QACI,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE;YACL,0BAA0B;YAC1B,yDAAyD;YACzD,gCAAgC;SACnC;KACJ;IACD;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,GAAG,CAAC,OAAO;KAC1B;CACJ,CAAC;AAEsB,SAAK,GAAG,IAAA,4BAAK,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC"}
|
package/dist/src/Factory.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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
8
|
static Reporters(args: Args.CommandLineOptions): ReadonlyArray<ResultReporter>;
|
|
8
9
|
}
|
|
@@ -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"}
|
|
@@ -12,7 +12,7 @@ class JUnitReporter extends XMLReporter_1.default {
|
|
|
12
12
|
const data = {
|
|
13
13
|
testsuites: Object.values(results).map((result, index) => JUnitReporter.testSuite(result, index))
|
|
14
14
|
};
|
|
15
|
-
return xml_1.default(data, { indent: ' ' });
|
|
15
|
+
return (0, xml_1.default)(data, { indent: ' ' });
|
|
16
16
|
}
|
|
17
17
|
static testSuite(results, id) {
|
|
18
18
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JUnitReporter.js","sourceRoot":"","sources":["../../../src/Reporters/JUnitReporter.ts"],"names":[],"mappings":";;;;;AACA,8CAAsB;AACtB,qEAA6C;AAC7C,wDAAmD;AAEnD,gEAAwC;AAExC,MAAqB,aAAc,SAAQ,qBAAW;IAGlD,GAAG,CAAC,OAAyC;QACzC,MAA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AI,EAAE,MAAA,MAAM,CAAC,KAAK,0CAAE,IAAI;oBACxB,OAAO,EAAE,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO;iBACjC;aACJ;SACJ,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,MAAkB;;QACnC,OAAO;YACH,KAAK,EAAE;gBACH,KAAK,EAAE;oBACH,IAAI,EAAE,MAAA,MAAM,CAAC,KAAK,0CAAE,IAAI;oBACxB,OAAO,EAAE,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO;iBACjC;aACJ;SACJ,CAAC;IACN,CAAC;;AArFL,gCAsFC;AArFmB,6BAAe,GAAW,WAAW,CAAC"}
|
|
@@ -20,7 +20,7 @@ class SonarReporter extends XMLReporter_1.default {
|
|
|
20
20
|
.map(file => SonarReporter.testSuite(results[file], file))
|
|
21
21
|
]
|
|
22
22
|
};
|
|
23
|
-
return xml_1.default(data, { indent: ' ' });
|
|
23
|
+
return (0, xml_1.default)(data, { indent: ' ' });
|
|
24
24
|
}
|
|
25
25
|
static testSuite(results, file) {
|
|
26
26
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SonarReporter.js","sourceRoot":"","sources":["../../../src/Reporters/SonarReporter.ts"],"names":[],"mappings":";;;;;AACA,8CAAsB;AACtB,wDAAmD;AAEnD,gEAAwC;AACxC,gDAAwB;AAExB,MAAqB,aAAc,SAAQ,qBAAW;IAGlD,GAAG,CAAC,OAAyC;QACzC,MAAM,IAAI,GAAG;YACT,cAAc,EAAE;gBACZ;oBACI,KAAK,EAAE;wBACH,OAAO,EAAE,CAAC;qBACb;iBACJ;gBACD,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;qBAClB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;aACjE;SACJ,CAAC;QACF,OAAO,aAAG,
|
|
1
|
+
{"version":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3,"file":"TestRunner.d.ts","sourceRoot":"","sources":["../../../src/Runners/TestRunner.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,UAAU;IAEf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,aAAa,CAAC,cAAc,CAAC;IAE/D,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TestRunner.d.ts","sourceRoot":"","sources":["../../../src/Runners/TestRunner.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,UAAU;IAEf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,aAAa,CAAC,cAAc,CAAC;IAE/D,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IA2BlF,OAAO,CAAC,MAAM,CAAC,OAAO;CAIzB"}
|
|
@@ -35,12 +35,13 @@ class TestRunner {
|
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
37
37
|
const duration = TestRunner.msSince(start);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const typedError = error;
|
|
39
|
+
if (typedError instanceof assert_1.AssertionError) {
|
|
40
|
+
yield Promise.all(this.reporters.map(r => r.testFailed(suite, name, typedError, duration)));
|
|
41
|
+
return new TestResult_1.default(ResultType_1.ResultType.Failed, duration, typedError);
|
|
41
42
|
}
|
|
42
|
-
yield Promise.all(this.reporters.map(r => r.testErrored(suite, name,
|
|
43
|
-
return new TestResult_1.default(ResultType_1.ResultType.Error, duration,
|
|
43
|
+
yield Promise.all(this.reporters.map(r => r.testErrored(suite, name, typedError, duration)));
|
|
44
|
+
return new TestResult_1.default(ResultType_1.ResultType.Error, duration, typedError);
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestRunner.js","sourceRoot":"","sources":["../../../src/Runners/TestRunner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,wDAAqD;AAErD,yEAAiD;AACjD,mCAAsC;AAEtC,MAAqB,UAAU;IAE3B,YAA6B,SAAwC;QAAxC,cAAS,GAAT,SAAS,CAA+B;IAAI,CAAC;IAEpE,OAAO,CAAC,IAAY,EAAE,IAAc,EAAE,KAAgB;;YACxD,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;YACvE,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;gBAC1B,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC1E,OAAO,IAAI,oBAAU,CAAC,uBAAU,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;aACnD;YAED,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAC/B,IAAI;gBACA,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,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,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAS,CAAC;IACzD,CAAC;CACJ;AAnCD,6BAmCC"}
|
package/icon.svg
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
4
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
5
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
6
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
9
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
10
|
+
sodipodi:docname="icon.svg"
|
|
11
|
+
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
|
12
|
+
inkscape:export-ydpi="96"
|
|
13
|
+
inkscape:export-xdpi="96"
|
|
14
|
+
inkscape:export-filename="X:\ecoAPM\xunit.ts\docs\assets\icon.png"
|
|
15
|
+
id="svg875"
|
|
16
|
+
version="1.1"
|
|
17
|
+
viewBox="0 0 128 128"
|
|
18
|
+
height="128"
|
|
19
|
+
width="128">
|
|
20
|
+
<defs
|
|
21
|
+
id="defs869" />
|
|
22
|
+
<sodipodi:namedview
|
|
23
|
+
inkscape:window-maximized="1"
|
|
24
|
+
inkscape:window-y="58"
|
|
25
|
+
inkscape:window-x="1912"
|
|
26
|
+
inkscape:window-height="987"
|
|
27
|
+
inkscape:window-width="1680"
|
|
28
|
+
width="128mm"
|
|
29
|
+
units="px"
|
|
30
|
+
showgrid="false"
|
|
31
|
+
inkscape:document-rotation="0"
|
|
32
|
+
inkscape:current-layer="layer1"
|
|
33
|
+
inkscape:document-units="px"
|
|
34
|
+
inkscape:cy="71.552618"
|
|
35
|
+
inkscape:cx="79.729008"
|
|
36
|
+
inkscape:zoom="3.959798"
|
|
37
|
+
inkscape:pageshadow="2"
|
|
38
|
+
inkscape:pageopacity="0.0"
|
|
39
|
+
borderopacity="1.0"
|
|
40
|
+
bordercolor="#666666"
|
|
41
|
+
pagecolor="#ffffff"
|
|
42
|
+
id="base" />
|
|
43
|
+
<metadata
|
|
44
|
+
id="metadata872">
|
|
45
|
+
<rdf:RDF>
|
|
46
|
+
<cc:Work
|
|
47
|
+
rdf:about="">
|
|
48
|
+
<dc:format>image/svg+xml</dc:format>
|
|
49
|
+
<dc:type
|
|
50
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
51
|
+
<dc:title></dc:title>
|
|
52
|
+
</cc:Work>
|
|
53
|
+
</rdf:RDF>
|
|
54
|
+
</metadata>
|
|
55
|
+
<g
|
|
56
|
+
id="layer1"
|
|
57
|
+
inkscape:groupmode="layer"
|
|
58
|
+
inkscape:label="Layer 1">
|
|
59
|
+
<g
|
|
60
|
+
transform="matrix(-3.7139957,0,0,3.7296926,884.38404,-159.89924)"
|
|
61
|
+
style="font-style:normal;font-weight:normal;font-size:50.8px;line-height:1.25;font-family:sans-serif;fill:#bfbfbf;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
|
62
|
+
id="text2766-0"
|
|
63
|
+
aria-label="🗸">
|
|
64
|
+
<path
|
|
65
|
+
sodipodi:nodetypes="ccsccccc"
|
|
66
|
+
id="path2805"
|
|
67
|
+
style="font-size:50.8px;fill:#bfbfbf;fill-opacity:1;stroke-width:0.264583"
|
|
68
|
+
d="m 231.8494,43.408198 0.74414,1.289843 c -4.84518,3.423047 -9.33483,7.755599 -13.46894,12.997656 -4.13412,5.242057 -7.11895,10.376628 -8.9545,15.403711 l -1.0914,0.719336 c -0.94258,0.611849 -1.75287,1.223698 -2.43086,1.835547 -1.21639,-4.400349 7.20052,-16.248511 12.05508,-21.480859 4.15065,-4.415235 8.53281,-8.003646 13.14648,-10.765234 z" />
|
|
69
|
+
</g>
|
|
70
|
+
<text
|
|
71
|
+
transform="scale(0.99789345,1.002111)"
|
|
72
|
+
xml:space="preserve"
|
|
73
|
+
style="font-style:normal;font-weight:normal;font-size:189.069px;line-height:1.25;font-family:sans-serif;fill:#538d43;fill-opacity:1;stroke:none;stroke-width:0.984735"
|
|
74
|
+
x="-11.659032"
|
|
75
|
+
y="150.47607"
|
|
76
|
+
id="text2766"><tspan
|
|
77
|
+
sodipodi:role="line"
|
|
78
|
+
id="tspan2764"
|
|
79
|
+
x="-11.659032"
|
|
80
|
+
y="150.47607"
|
|
81
|
+
style="font-size:189.069px;fill:#538d43;fill-opacity:1;stroke-width:0.984735">🗸</tspan></text>
|
|
82
|
+
</g>
|
|
83
|
+
</svg>
|
package/logo.svg
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
4
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
5
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
6
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
9
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
10
|
+
inkscape:export-ydpi="96"
|
|
11
|
+
inkscape:export-xdpi="96"
|
|
12
|
+
inkscape:export-filename="X:\ecoAPM\xunit.ts\logo-black.png"
|
|
13
|
+
sodipodi:docname="logo.svg"
|
|
14
|
+
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
|
15
|
+
id="svg8"
|
|
16
|
+
version="1.1"
|
|
17
|
+
viewBox="0 0 400 128"
|
|
18
|
+
height="128"
|
|
19
|
+
width="400">
|
|
20
|
+
<defs
|
|
21
|
+
id="defs2">
|
|
22
|
+
<rect
|
|
23
|
+
id="rect2858"
|
|
24
|
+
height="56"
|
|
25
|
+
width="61.5"
|
|
26
|
+
y="39"
|
|
27
|
+
x="127.5" />
|
|
28
|
+
<rect
|
|
29
|
+
id="rect2746"
|
|
30
|
+
height="38.364582"
|
|
31
|
+
width="5.0270834"
|
|
32
|
+
y="94.720833"
|
|
33
|
+
x="102.39375" />
|
|
34
|
+
</defs>
|
|
35
|
+
<sodipodi:namedview
|
|
36
|
+
inkscape:window-maximized="1"
|
|
37
|
+
inkscape:window-y="-8"
|
|
38
|
+
inkscape:window-x="-8"
|
|
39
|
+
inkscape:window-height="1137"
|
|
40
|
+
inkscape:window-width="1920"
|
|
41
|
+
inkscape:pagecheckerboard="false"
|
|
42
|
+
units="px"
|
|
43
|
+
showgrid="false"
|
|
44
|
+
inkscape:document-rotation="0"
|
|
45
|
+
inkscape:current-layer="layer1"
|
|
46
|
+
inkscape:document-units="px"
|
|
47
|
+
inkscape:cy="111.1524"
|
|
48
|
+
inkscape:cx="243.86486"
|
|
49
|
+
inkscape:zoom="2"
|
|
50
|
+
inkscape:pageshadow="2"
|
|
51
|
+
inkscape:pageopacity="0"
|
|
52
|
+
borderopacity="1.0"
|
|
53
|
+
bordercolor="#666666"
|
|
54
|
+
pagecolor="#000000"
|
|
55
|
+
id="base" />
|
|
56
|
+
<metadata
|
|
57
|
+
id="metadata5">
|
|
58
|
+
<rdf:RDF>
|
|
59
|
+
<cc:Work
|
|
60
|
+
rdf:about="">
|
|
61
|
+
<dc:format>image/svg+xml</dc:format>
|
|
62
|
+
<dc:type
|
|
63
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
64
|
+
<dc:title></dc:title>
|
|
65
|
+
</cc:Work>
|
|
66
|
+
</rdf:RDF>
|
|
67
|
+
</metadata>
|
|
68
|
+
<g
|
|
69
|
+
id="layer1"
|
|
70
|
+
inkscape:groupmode="layer"
|
|
71
|
+
inkscape:label="Layer 1">
|
|
72
|
+
<text
|
|
73
|
+
id="text2742"
|
|
74
|
+
y="168.27499"
|
|
75
|
+
x="-11.377083"
|
|
76
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:127px;line-height:1.25;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
|
77
|
+
xml:space="preserve"><tspan
|
|
78
|
+
sodipodi:role="line"
|
|
79
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:127px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';stroke-width:0.264583"
|
|
80
|
+
y="168.27499"
|
|
81
|
+
x="-11.377083"
|
|
82
|
+
id="tspan2740" /><tspan
|
|
83
|
+
id="tspan2754"
|
|
84
|
+
sodipodi:role="line"
|
|
85
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:127px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';stroke-width:0.264583"
|
|
86
|
+
y="327.02499"
|
|
87
|
+
x="-11.377083" /></text>
|
|
88
|
+
<text
|
|
89
|
+
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2746);fill:#000000;fill-opacity:1;stroke:none;"
|
|
90
|
+
id="text2744"
|
|
91
|
+
xml:space="preserve" />
|
|
92
|
+
<text
|
|
93
|
+
id="text2752"
|
|
94
|
+
y="26.987499"
|
|
95
|
+
x="35.983334"
|
|
96
|
+
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
|
97
|
+
xml:space="preserve"><tspan
|
|
98
|
+
style="stroke-width:0.264583"
|
|
99
|
+
y="26.987499"
|
|
100
|
+
x="35.983334"
|
|
101
|
+
id="tspan2750"
|
|
102
|
+
sodipodi:role="line" /></text>
|
|
103
|
+
<text
|
|
104
|
+
transform="scale(0.99994519,1.0000548)"
|
|
105
|
+
id="text2758"
|
|
106
|
+
y="98.652382"
|
|
107
|
+
x="112.43309"
|
|
108
|
+
style="font-style:normal;font-weight:normal;font-size:95.8669px;line-height:0;font-family:sans-serif;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.264216"
|
|
109
|
+
xml:space="preserve"><tspan
|
|
110
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:95.8669px;line-height:1;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';fill:#000000;fill-opacity:1;stroke-width:0.264216"
|
|
111
|
+
y="98.652382"
|
|
112
|
+
x="112.43309"
|
|
113
|
+
id="tspan2756"
|
|
114
|
+
sodipodi:role="line"><tspan
|
|
115
|
+
id="tspan3014"
|
|
116
|
+
style="fill:#ffffff;fill-opacity:1">unit</tspan><tspan
|
|
117
|
+
id="tspan3000"
|
|
118
|
+
style="fill:#808080;fill-opacity:1">.</tspan><tspan
|
|
119
|
+
id="tspan3016"
|
|
120
|
+
style="fill:#ffffff;fill-opacity:1">ts</tspan></tspan></text>
|
|
121
|
+
<text
|
|
122
|
+
style="fill:black;fill-opacity:1;line-height:1.25;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;white-space:pre;shape-inside:url(#rect2858);"
|
|
123
|
+
id="text2856"
|
|
124
|
+
xml:space="preserve" />
|
|
125
|
+
</g>
|
|
126
|
+
<g
|
|
127
|
+
inkscape:label="Layer 2"
|
|
128
|
+
id="layer2"
|
|
129
|
+
inkscape:groupmode="layer">
|
|
130
|
+
<g
|
|
131
|
+
transform="matrix(-3.7140083,0,0,3.7296903,884.38712,-159.89914)"
|
|
132
|
+
style="font-style:normal;font-weight:normal;font-size:50.8px;line-height:1.25;font-family:sans-serif;fill:#bfbfbf;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
|
133
|
+
id="text2766-0"
|
|
134
|
+
aria-label="🗸">
|
|
135
|
+
<path
|
|
136
|
+
sodipodi:nodetypes="ccsccccc"
|
|
137
|
+
id="path2805"
|
|
138
|
+
style="font-size:50.8px;fill:#bfbfbf;fill-opacity:1;stroke-width:0.264583"
|
|
139
|
+
d="m 231.8494,43.408198 0.74414,1.289843 c -4.84518,3.423047 -9.33483,7.755599 -13.46894,12.997656 -4.13412,5.242057 -7.11895,10.376628 -8.9545,15.403711 l -1.0914,0.719336 c -0.94258,0.611849 -1.75287,1.223698 -2.43086,1.835547 -1.21639,-4.400349 7.20052,-16.248511 12.05508,-21.480859 4.15065,-4.415235 8.53281,-8.003646 13.14648,-10.765234 z" />
|
|
140
|
+
</g>
|
|
141
|
+
<text
|
|
142
|
+
transform="scale(0.99789547,1.002109)"
|
|
143
|
+
xml:space="preserve"
|
|
144
|
+
style="font-style:normal;font-weight:normal;font-size:189.07px;line-height:1.25;font-family:sans-serif;fill:#538d43;fill-opacity:1;stroke:none;stroke-width:0.984736"
|
|
145
|
+
x="-11.659009"
|
|
146
|
+
y="150.47635"
|
|
147
|
+
id="text2766"><tspan
|
|
148
|
+
sodipodi:role="line"
|
|
149
|
+
id="tspan2764"
|
|
150
|
+
x="-11.659009"
|
|
151
|
+
y="150.47635"
|
|
152
|
+
style="font-size:189.07px;fill:#538d43;fill-opacity:1;stroke-width:0.984736">🗸</tspan></text>
|
|
153
|
+
</g>
|
|
154
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xunit.ts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A unit testing framework for TypeScript, following standard xUnit patterns",
|
|
5
5
|
"main": "dist/xunit.js",
|
|
6
6
|
"author": "ecoAPM LLC",
|
|
7
|
+
"homepage": "https://github.com/ecoAPM/xunit.ts",
|
|
8
|
+
"bugs": "https://github.com/ecoAPM/xunit.ts/issues",
|
|
7
9
|
"license": "MIT",
|
|
8
10
|
"dependencies": {
|
|
9
11
|
"colors": "1.4.0",
|
|
10
12
|
"command-line-args": "5.2.0",
|
|
11
13
|
"command-line-usage": "6.1.1",
|
|
12
14
|
"lodash.isequal": "4.5.0",
|
|
13
|
-
"typescript": "4.
|
|
15
|
+
"typescript": "4.5.2",
|
|
14
16
|
"xml": "1.0.1"
|
|
15
17
|
},
|
|
16
18
|
"devDependencies": {
|
|
@@ -18,17 +20,17 @@
|
|
|
18
20
|
"@types/command-line-args": "5.2.0",
|
|
19
21
|
"@types/command-line-usage": "5.0.2",
|
|
20
22
|
"@types/lodash.isequal": "4.5.5",
|
|
21
|
-
"@types/node": "16.
|
|
23
|
+
"@types/node": "16.11.10",
|
|
22
24
|
"@types/xml": "1.0.6",
|
|
23
|
-
"notosans": "
|
|
25
|
+
"notosans": "5.0.0",
|
|
24
26
|
"ts-mockito": "2.6.1",
|
|
25
|
-
"ts-node": "10.
|
|
27
|
+
"ts-node": "10.4.0"
|
|
26
28
|
},
|
|
27
29
|
"scripts": {
|
|
28
30
|
"clean": "rm -rf dist",
|
|
29
31
|
"build": "tsc",
|
|
30
32
|
"test": "node dist/cli.js dist/tests",
|
|
31
|
-
"tsdoc": "cp -r node_modules/notosans
|
|
33
|
+
"tsdoc": "cp -r node_modules/notosans/* docs/assets && ts-node tsdoc.ts"
|
|
32
34
|
},
|
|
33
35
|
"bin": {
|
|
34
36
|
"xunit": "dist/cli.js"
|
|
@@ -15,8 +15,8 @@ import { AssertionError } from "assert";
|
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.stringContains(needle, haystack);
|
|
17
17
|
*/
|
|
18
|
-
export default function StringContains(needle: string, haystack: string|null, message?: string) {
|
|
19
|
-
if(haystack !== undefined && haystack !== null && haystack.indexOf(needle)
|
|
18
|
+
export default function StringContains(needle: string, haystack: string | null, message?: string) {
|
|
19
|
+
if (haystack !== undefined && haystack !== null && haystack.indexOf(needle) > -1) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -15,8 +15,10 @@ import { AssertionError } from "assert";
|
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.stringDoesNotEndWith(needle, haystack);
|
|
17
17
|
*/
|
|
18
|
-
export default function StringDoesNotEndWith(needle: string, haystack: string|null, message?: string) {
|
|
19
|
-
if(haystack === undefined || haystack === null
|
|
18
|
+
export default function StringDoesNotEndWith(needle: string, haystack: string | null, message?: string) {
|
|
19
|
+
if (haystack === undefined || haystack === null
|
|
20
|
+
|| haystack.indexOf(needle) === -1
|
|
21
|
+
|| haystack.indexOf(needle) !== haystack.length - needle.length) {
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
|
|
@@ -15,8 +15,10 @@ import { AssertionError } from "assert";
|
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.stringEndsWith(needle, haystack);
|
|
17
17
|
*/
|
|
18
|
-
export default function StringEndsWith(needle: string, haystack: string|null, message?: string) {
|
|
19
|
-
if(haystack !== undefined && haystack !== null
|
|
18
|
+
export default function StringEndsWith(needle: string, haystack: string | null, message?: string) {
|
|
19
|
+
if (haystack !== undefined && haystack !== null
|
|
20
|
+
&& haystack.indexOf(needle) > -1
|
|
21
|
+
&& haystack.indexOf(needle) === haystack.length - needle.length) {
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
|
package/src/CLI.ts
CHANGED
|
@@ -2,7 +2,6 @@ import Usage from 'command-line-usage';
|
|
|
2
2
|
import JUnitReporter from './Reporters/JUnitReporter';
|
|
3
3
|
import Process from "process";
|
|
4
4
|
import Args from "command-line-args";
|
|
5
|
-
import Factory from "./Factory";
|
|
6
5
|
import Runner from "./Runners/Runner";
|
|
7
6
|
import SonarReporter from "./Reporters/SonarReporter";
|
|
8
7
|
|
|
@@ -72,7 +71,7 @@ export default class CLI {
|
|
|
72
71
|
|
|
73
72
|
private static readonly usage = Usage(CLI.sections);
|
|
74
73
|
|
|
75
|
-
constructor(private readonly process: typeof Process) {
|
|
74
|
+
constructor(private readonly runnerFactory: (args: Args.CommandLineOptions) => Runner, private readonly process: typeof Process) {
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
async run(): Promise<boolean> {
|
|
@@ -84,14 +83,16 @@ export default class CLI {
|
|
|
84
83
|
return true;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
const runner =
|
|
86
|
+
const runner = this.runnerFactory(args);
|
|
88
87
|
|
|
89
88
|
try {
|
|
90
89
|
const results = await runner.runAll(args.dir);
|
|
91
90
|
return Runner.allTestsPassed(results);
|
|
92
91
|
} catch (error) {
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
if (error instanceof Error) {
|
|
93
|
+
this.process.stderr.write(`An unhandled ${error.name} occurred: ${error.message}\n`);
|
|
94
|
+
this.process.stderr.write(error.stack?.toString() || '(no call stack)\n');
|
|
95
|
+
}
|
|
95
96
|
return false;
|
|
96
97
|
}
|
|
97
98
|
}
|
package/src/Factory.ts
CHANGED
|
@@ -12,11 +12,11 @@ import fs from "fs/promises";
|
|
|
12
12
|
import SonarReporter from "./Reporters/SonarReporter";
|
|
13
13
|
|
|
14
14
|
export default class Factory {
|
|
15
|
-
|
|
15
|
+
static readonly file_system = new FileSystem(fs);
|
|
16
16
|
|
|
17
17
|
static Runner(args: Args.CommandLineOptions) {
|
|
18
|
-
const loader = new TestSuiteLoader(
|
|
19
|
-
const reporters =
|
|
18
|
+
const loader = new TestSuiteLoader(Factory.file_system);
|
|
19
|
+
const reporters = Factory.Reporters(args);
|
|
20
20
|
const test_runner = new TestRunner(reporters);
|
|
21
21
|
const test_suite_runner = new TestSuiteRunner(test_runner, reporters);
|
|
22
22
|
|
|
@@ -26,8 +26,8 @@ export default class Factory {
|
|
|
26
26
|
static Reporters(args: Args.CommandLineOptions): ReadonlyArray<ResultReporter> {
|
|
27
27
|
return [
|
|
28
28
|
!args.quiet ? new ConsoleReporter(new Output(process.stdout)) : null,
|
|
29
|
-
args.junit !== undefined ? new JUnitReporter(
|
|
30
|
-
args.sonar !== undefined ? new SonarReporter(
|
|
29
|
+
args.junit !== undefined ? new JUnitReporter(Factory.file_system, args.junit ?? JUnitReporter.defaultFileName) : null,
|
|
30
|
+
args.sonar !== undefined ? new SonarReporter(Factory.file_system, args.sonar ?? SonarReporter.defaultFileName) : null
|
|
31
31
|
].filter(r => r !== null) as ResultReporter[];
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -25,13 +25,14 @@ export default class TestRunner {
|
|
|
25
25
|
|
|
26
26
|
} catch (error) {
|
|
27
27
|
const duration = TestRunner.msSince(start);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const typedError = error as Error;
|
|
29
|
+
if (typedError instanceof AssertionError) {
|
|
30
|
+
await Promise.all(this.reporters.map(r => r.testFailed(suite, name, typedError, duration)));
|
|
31
|
+
return new TestResult(ResultType.Failed, duration, typedError);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
await Promise.all(this.reporters.map(r => r.testErrored(suite, name,
|
|
34
|
-
return new TestResult(ResultType.Error, duration,
|
|
34
|
+
await Promise.all(this.reporters.map(r => r.testErrored(suite, name, typedError, duration)));
|
|
35
|
+
return new TestResult(ResultType.Error, duration, typedError);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|