xunit.ts 1.0.2 → 1.2.0
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/cli.ts +5 -5
- package/dist/cli.js.map +1 -1
- package/dist/src/Assertions/Contains.js +1 -1
- package/dist/src/Assertions/Contains.js.map +1 -1
- package/dist/src/Assertions/Count.js.map +1 -1
- package/dist/src/Assertions/Defined.js +2 -2
- package/dist/src/Assertions/Defined.js.map +1 -1
- package/dist/src/Assertions/DoesNotContain.js +1 -1
- package/dist/src/Assertions/DoesNotContain.js.map +1 -1
- package/dist/src/Assertions/DoesNotThrow.js +2 -2
- package/dist/src/Assertions/DoesNotThrow.js.map +1 -1
- package/dist/src/Assertions/Empty.js +1 -1
- package/dist/src/Assertions/Empty.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/False.js +1 -1
- package/dist/src/Assertions/False.js.map +1 -1
- package/dist/src/Assertions/InstanceOf.d.ts +1 -1
- package/dist/src/Assertions/InstanceOf.d.ts.map +1 -1
- package/dist/src/Assertions/InstanceOf.js.map +1 -1
- package/dist/src/Assertions/NotEmpty.js +2 -2
- package/dist/src/Assertions/NotEmpty.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/NotNull.js +2 -2
- package/dist/src/Assertions/NotNull.js.map +1 -1
- package/dist/src/Assertions/Null.js +1 -1
- package/dist/src/Assertions/Null.js.map +1 -1
- package/dist/src/Assertions/StringContains.js +1 -1
- package/dist/src/Assertions/StringContains.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotContain.d.ts.map +1 -1
- package/dist/src/Assertions/StringDoesNotContain.js +1 -1
- package/dist/src/Assertions/StringDoesNotContain.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.js +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotStartWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringDoesNotStartWith.js +1 -1
- package/dist/src/Assertions/StringDoesNotStartWith.js.map +1 -1
- package/dist/src/Assertions/StringEndsWith.js +1 -1
- package/dist/src/Assertions/StringEndsWith.js.map +1 -1
- package/dist/src/Assertions/StringStartsWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringStartsWith.js +1 -1
- package/dist/src/Assertions/StringStartsWith.js.map +1 -1
- package/dist/src/Assertions/Throws.js +1 -1
- package/dist/src/Assertions/Throws.js.map +1 -1
- package/dist/src/Assertions/True.js +1 -1
- package/dist/src/Assertions/True.js.map +1 -1
- package/dist/src/Assertions/Undefined.js +1 -1
- package/dist/src/Assertions/Undefined.js.map +1 -1
- package/dist/src/Assertions/index.d.ts +22 -22
- package/dist/src/Assertions/index.d.ts.map +1 -1
- package/dist/src/Assertions/index.js.map +1 -1
- package/dist/src/CLI.d.ts +1 -0
- package/dist/src/CLI.d.ts.map +1 -1
- package/dist/src/CLI.js +19 -8
- package/dist/src/CLI.js.map +1 -1
- package/dist/src/Factory.d.ts +4 -4
- package/dist/src/Factory.d.ts.map +1 -1
- package/dist/src/Factory.js.map +1 -1
- package/dist/src/Framework/ResultType.d.ts.map +1 -1
- package/dist/src/Framework/ResultType.js.map +1 -1
- package/dist/src/Framework/Test.d.ts.map +1 -1
- package/dist/src/Framework/Test.js.map +1 -1
- package/dist/src/Framework/TestName.d.ts.map +1 -1
- package/dist/src/Framework/TestName.js.map +1 -1
- package/dist/src/Framework/TestResult.d.ts.map +1 -1
- package/dist/src/Framework/TestResult.js.map +1 -1
- package/dist/src/Framework/TestSuite.d.ts +3 -2
- package/dist/src/Framework/TestSuite.d.ts.map +1 -1
- package/dist/src/Framework/TestSuite.js +12 -2
- package/dist/src/Framework/TestSuite.js.map +1 -1
- package/dist/src/Framework/TestSuiteResults.d.ts +1 -1
- package/dist/src/Framework/TestSuiteResults.d.ts.map +1 -1
- package/dist/src/Framework/TestSuiteResults.js.map +1 -1
- package/dist/src/IO/FileSystem.d.ts +2 -2
- package/dist/src/IO/FileSystem.d.ts.map +1 -1
- package/dist/src/IO/FileSystem.js +6 -6
- package/dist/src/IO/FileSystem.js.map +1 -1
- package/dist/src/IO/Output.d.ts.map +1 -1
- package/dist/src/IO/Output.js.map +1 -1
- package/dist/src/Reporters/ConsoleReporter.d.ts.map +1 -1
- package/dist/src/Reporters/ConsoleReporter.js +8 -7
- package/dist/src/Reporters/ConsoleReporter.js.map +1 -1
- package/dist/src/Reporters/FileReporter.d.ts.map +1 -1
- package/dist/src/Reporters/FileReporter.js +1 -0
- package/dist/src/Reporters/FileReporter.js.map +1 -1
- package/dist/src/Reporters/JUnitReporter.d.ts +2 -2
- package/dist/src/Reporters/JUnitReporter.d.ts.map +1 -1
- package/dist/src/Reporters/JUnitReporter.js +7 -7
- package/dist/src/Reporters/JUnitReporter.js.map +1 -1
- package/dist/src/Reporters/ResultReporter.d.ts +3 -3
- package/dist/src/Reporters/ResultReporter.d.ts.map +1 -1
- package/dist/src/Reporters/SonarReporter.d.ts +2 -2
- package/dist/src/Reporters/SonarReporter.d.ts.map +1 -1
- package/dist/src/Reporters/SonarReporter.js +16 -16
- package/dist/src/Reporters/SonarReporter.js.map +1 -1
- package/dist/src/Reporters/XMLReporter.d.ts.map +1 -1
- package/dist/src/Reporters/XMLReporter.js.map +1 -1
- package/dist/src/Runners/Runner.d.ts +3 -3
- package/dist/src/Runners/Runner.d.ts.map +1 -1
- package/dist/src/Runners/Runner.js +8 -8
- package/dist/src/Runners/Runner.js.map +1 -1
- package/dist/src/Runners/TestRunner.d.ts +4 -4
- package/dist/src/Runners/TestRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestRunner.js +4 -4
- package/dist/src/Runners/TestRunner.js.map +1 -1
- package/dist/src/Runners/TestSuiteLoader.d.ts +4 -4
- package/dist/src/Runners/TestSuiteLoader.d.ts.map +1 -1
- package/dist/src/Runners/TestSuiteLoader.js +28 -20
- package/dist/src/Runners/TestSuiteLoader.js.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.d.ts +6 -6
- package/dist/src/Runners/TestSuiteRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.js +3 -3
- package/dist/src/Runners/TestSuiteRunner.js.map +1 -1
- package/dist/xunit.d.ts +3 -3
- package/dist/xunit.d.ts.map +1 -1
- package/dist/xunit.js.map +1 -1
- package/package.json +39 -37
- package/src/Assertions/Contains.ts +10 -10
- package/src/Assertions/Count.ts +11 -11
- package/src/Assertions/Defined.ts +11 -11
- package/src/Assertions/DoesNotContain.ts +11 -11
- package/src/Assertions/DoesNotThrow.ts +13 -13
- package/src/Assertions/Empty.ts +11 -11
- package/src/Assertions/Equal.ts +12 -12
- package/src/Assertions/False.ts +11 -11
- package/src/Assertions/InstanceOf.ts +2 -2
- package/src/Assertions/NotEmpty.ts +11 -11
- package/src/Assertions/NotEqual.ts +12 -12
- package/src/Assertions/NotNull.ts +11 -11
- package/src/Assertions/Null.ts +11 -11
- package/src/Assertions/StringContains.ts +11 -11
- package/src/Assertions/StringDoesNotContain.ts +12 -12
- package/src/Assertions/StringDoesNotEndWith.ts +13 -13
- package/src/Assertions/StringDoesNotStartWith.ts +12 -12
- package/src/Assertions/StringEndsWith.ts +13 -13
- package/src/Assertions/StringStartsWith.ts +12 -12
- package/src/Assertions/Throws.ts +11 -11
- package/src/Assertions/True.ts +11 -11
- package/src/Assertions/Undefined.ts +12 -12
- package/src/Assertions/index.ts +45 -45
- package/src/CLI.ts +96 -85
- package/src/Factory.ts +25 -25
- package/src/Framework/ResultType.ts +4 -4
- package/src/Framework/Test.ts +6 -6
- package/src/Framework/TestName.ts +7 -7
- package/src/Framework/TestResult.ts +3 -2
- package/src/Framework/TestSuite.ts +29 -18
- package/src/Framework/TestSuiteResults.ts +17 -16
- package/src/IO/FileSystem.ts +28 -29
- package/src/IO/Output.ts +21 -20
- package/src/Reporters/ConsoleReporter.ts +88 -87
- package/src/Reporters/FileReporter.ts +29 -29
- package/src/Reporters/JUnitReporter.ts +80 -80
- package/src/Reporters/ResultReporter.ts +20 -12
- package/src/Reporters/SonarReporter.ts +86 -86
- package/src/Reporters/XMLReporter.ts +6 -6
- package/src/Runners/Runner.ts +21 -21
- package/src/Runners/TestRunner.ts +34 -33
- package/src/Runners/TestSuiteLoader.ts +51 -45
- package/src/Runners/TestSuiteRunner.ts +27 -26
- package/tsconfig.json +23 -26
- package/xunit.ts +6 -6
- package/.editorconfig +0 -24
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -26
- package/LICENSE +0 -21
- package/README.md +0 -132
- package/SECURITY.md +0 -11
- package/icon.svg +0 -83
- package/logo.svg +0 -154
- package/sonar-project.properties +0 -6
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import TestSuiteResults from "../Framework/TestSuiteResults";
|
|
3
3
|
|
|
4
4
|
export default abstract class XMLReporter extends FileReporter {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
async runCompleted(results: Record<string, TestSuiteResults>): Promise<void> {
|
|
6
|
+
const xmlString = this.xml(results);
|
|
7
|
+
await this.file_system.save(xmlString, this.path);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
abstract xml(results: Record<string, TestSuiteResults>): string;
|
|
11
11
|
}
|
package/src/Runners/Runner.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import TestSuiteLoader from
|
|
2
|
-
import TestSuiteRunner from
|
|
1
|
+
import TestSuiteLoader from "./TestSuiteLoader";
|
|
2
|
+
import TestSuiteRunner from "./TestSuiteRunner";
|
|
3
3
|
import ResultReporter from "../Reporters/ResultReporter";
|
|
4
4
|
import TestSuiteResults from "../Framework/TestSuiteResults";
|
|
5
|
-
import {ResultType} from
|
|
5
|
+
import { ResultType } from "../Framework/ResultType";
|
|
6
6
|
|
|
7
7
|
export default class Runner {
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
constructor(private readonly loader: TestSuiteLoader, private readonly runner: TestSuiteRunner, private readonly reporters: ReadonlyArray<ResultReporter>) {
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const suite = suites[file];
|
|
18
|
-
results[file] = await this.runner.runSuite(suite);
|
|
19
|
-
}
|
|
20
|
-
await Promise.all(this.reporters.map(r => r.runCompleted(results)));
|
|
21
|
-
return results;
|
|
22
|
-
}
|
|
12
|
+
static allTestsPassed(results: Record<string, TestSuiteResults>): boolean {
|
|
13
|
+
const tests_with_results = Object.values(results).filter(result => result.total() > 0);
|
|
14
|
+
return tests_with_results.length > 0
|
|
15
|
+
&& tests_with_results.filter(result => result.count(ResultType.Passed) < result.total()).length === 0;
|
|
16
|
+
}
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
async runAll(dir: string, filters: RegExp[]): Promise<Record<string, TestSuiteResults>> {
|
|
19
|
+
await Promise.all(this.reporters.map(r => r.runStarted()));
|
|
20
|
+
const results: Record<string, TestSuiteResults> = {};
|
|
21
|
+
const suites = await this.loader.loadTestSuites(dir, filters);
|
|
22
|
+
for (const file of Object.keys(suites)) {
|
|
23
|
+
const suite = suites[file];
|
|
24
|
+
results[file] = await this.runner.runSuite(suite, filters);
|
|
25
|
+
}
|
|
26
|
+
await Promise.all(this.reporters.map(r => r.runCompleted(results)));
|
|
27
|
+
return results;
|
|
28
|
+
}
|
|
29
29
|
}
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import TestInfo from
|
|
2
|
-
import TestSuite from
|
|
3
|
-
import { ResultType } from
|
|
4
|
-
import ResultReporter from
|
|
1
|
+
import TestInfo from "../Framework/TestInfo";
|
|
2
|
+
import TestSuite from "../Framework/TestSuite";
|
|
3
|
+
import { ResultType } from "../Framework/ResultType";
|
|
4
|
+
import ResultReporter from "../Reporters/ResultReporter";
|
|
5
5
|
import TestResult from "../Framework/TestResult";
|
|
6
|
-
import {AssertionError} from "assert";
|
|
6
|
+
import { AssertionError } from "assert";
|
|
7
7
|
|
|
8
8
|
export default class TestRunner {
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
constructor(private readonly reporters: ReadonlyArray<ResultReporter>) {
|
|
11
|
+
}
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return new TestResult(ResultType.Incomplete, 0);
|
|
17
|
-
}
|
|
13
|
+
private static msSince(start: [ number, number ]) {
|
|
14
|
+
const duration = process.hrtime(start);
|
|
15
|
+
return duration[0] * 1_000 + duration[1] / 1_000_000;
|
|
16
|
+
}
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
async runTest(name: string, info: TestInfo, suite: TestSuite): Promise<TestResult> {
|
|
19
|
+
await Promise.all(this.reporters.map(r => r.testStarted(suite, name)));
|
|
20
|
+
if (info.value === undefined) {
|
|
21
|
+
await Promise.all(this.reporters.map(r => r.testIncomplete(suite, name)));
|
|
22
|
+
return new TestResult(ResultType.Incomplete, 0);
|
|
23
|
+
}
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
25
|
+
const start = process.hrtime();
|
|
26
|
+
try {
|
|
27
|
+
await info.value.call(suite);
|
|
28
|
+
const duration = TestRunner.msSince(start);
|
|
29
|
+
await Promise.all(this.reporters.map(r => r.testPassed(suite, name, duration)));
|
|
30
|
+
return new TestResult(ResultType.Passed, duration);
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
} catch (error) {
|
|
33
|
+
const duration = TestRunner.msSince(start);
|
|
34
|
+
const typedError = error as Error;
|
|
35
|
+
if (typedError instanceof AssertionError) {
|
|
36
|
+
await Promise.all(this.reporters.map(r => r.testFailed(suite, name, typedError, duration)));
|
|
37
|
+
return new TestResult(ResultType.Failed, duration, typedError);
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
await Promise.all(this.reporters.map(r => r.testErrored(suite, name, typedError, duration)));
|
|
41
|
+
return new TestResult(ResultType.Error, duration, typedError);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
43
44
|
}
|
|
@@ -1,49 +1,55 @@
|
|
|
1
|
-
import TestSuite from
|
|
2
|
-
import FileSystem from
|
|
3
|
-
import path from
|
|
1
|
+
import TestSuite from "../Framework/TestSuite";
|
|
2
|
+
import FileSystem from "../IO/FileSystem";
|
|
3
|
+
import path from "path";
|
|
4
4
|
|
|
5
5
|
export default class TestSuiteLoader {
|
|
6
|
+
constructor(private readonly file_system: FileSystem) {
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
9
|
+
static async loadTestSuite(file: string, filters: RegExp[]) {
|
|
10
|
+
const module_path = TestSuiteLoader.getModulePath(__dirname, file);
|
|
11
|
+
const test_class = await import(module_path);
|
|
12
|
+
if (!(test_class.default?.prototype instanceof TestSuite)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const tests = test_class.default?.prototype.getTests(filters);
|
|
17
|
+
if (tests === undefined || Object.keys(tests).length === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const suite: TestSuite = new test_class.default();
|
|
22
|
+
suite.setTests(tests);
|
|
23
|
+
return suite;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static getModulePath(current_dir: string, file: string) {
|
|
27
|
+
const root = TestSuiteLoader.isFromNodeModules(path.resolve(current_dir))
|
|
28
|
+
? `..${path.sep}..${path.sep}..${path.sep}..${path.sep}..`
|
|
29
|
+
: `..${path.sep}..${path.sep}..`;
|
|
30
|
+
const extension = FileSystem.extension(file);
|
|
31
|
+
const module_name = extension.length > 0
|
|
32
|
+
? file.substring(0, file.length - extension.length - 1)
|
|
33
|
+
: file;
|
|
34
|
+
return `${root}${path.sep}${module_name}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static isFromNodeModules(dir: string) {
|
|
38
|
+
return dir.indexOf("node_modules") !== -1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async loadTestSuites(dir: string, filters: RegExp[]): Promise<Record<string, TestSuite>> {
|
|
42
|
+
const suites: Record<string, TestSuite> = {};
|
|
43
|
+
|
|
44
|
+
const files = (await this.file_system.getFiles(dir))
|
|
45
|
+
.filter((file) => FileSystem.extension(file) === FileSystem.extension(__filename));
|
|
46
|
+
|
|
47
|
+
for (const file of files) {
|
|
48
|
+
const suite = await TestSuiteLoader.loadTestSuite(file, filters);
|
|
49
|
+
if (suite !== undefined && suite !== null) {
|
|
50
|
+
suites[file] = suite;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return suites;
|
|
54
|
+
}
|
|
49
55
|
}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import ResultReporter from
|
|
2
|
-
import TestSuite from
|
|
3
|
-
import TestSuiteResults from
|
|
4
|
-
import TestInfo from
|
|
5
|
-
import TestRunner from
|
|
1
|
+
import ResultReporter from "../Reporters/ResultReporter";
|
|
2
|
+
import TestSuite from "../Framework/TestSuite";
|
|
3
|
+
import TestSuiteResults from "../Framework/TestSuiteResults";
|
|
4
|
+
import TestInfo from "../Framework/TestInfo";
|
|
5
|
+
import TestRunner from "./TestRunner";
|
|
6
6
|
|
|
7
7
|
export default class TestSuiteRunner {
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
constructor(private readonly runner: TestRunner, private readonly reporters: ReadonlyArray<ResultReporter>) {
|
|
10
|
+
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
async runSuite(suite: TestSuite, filters: RegExp[]) {
|
|
13
|
+
await Promise.all(this.reporters.map(r => r.suiteStarted(suite)));
|
|
14
|
+
const tests = suite.getTests(filters);
|
|
15
|
+
const results = await this.runTests(suite, tests);
|
|
16
|
+
await Promise.all(this.reporters.map(r => r.suiteCompleted(suite, results)));
|
|
17
|
+
return results;
|
|
18
|
+
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
async runTests(suite: TestSuite, tests: Record<string, TestInfo>) {
|
|
21
|
+
const results = new TestSuiteResults(suite);
|
|
22
|
+
if (tests === undefined || tests === null || Object.keys(tests).length === 0) {
|
|
23
|
+
await Promise.all(this.reporters.map(r => r.testIncomplete(suite, "(no tests found)")));
|
|
24
|
+
return results;
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const test_names = Object.keys(tests);
|
|
28
|
+
for (const name of test_names) {
|
|
29
|
+
const result = await this.runner.runTest(name, tests[name], suite);
|
|
30
|
+
results.addResult(name, result);
|
|
31
|
+
}
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
return results;
|
|
34
|
+
}
|
|
34
35
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"node_modules",
|
|
26
|
-
"dist"
|
|
27
|
-
]
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2015",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"outDir": "dist/",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationMap": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"emitDecoratorMetadata": true
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"xunit.ts",
|
|
16
|
+
"cli.ts"
|
|
17
|
+
],
|
|
18
|
+
"include": [
|
|
19
|
+
"**/*.ts"
|
|
20
|
+
],
|
|
21
|
+
"exclude": [
|
|
22
|
+
"dist",
|
|
23
|
+
"node_modules"
|
|
24
|
+
]
|
|
28
25
|
}
|
package/xunit.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Test from
|
|
2
|
-
import TestSuite from
|
|
3
|
-
import Assert from
|
|
1
|
+
import Test from "./src/Framework/Test";
|
|
2
|
+
import TestSuite from "./src/Framework/TestSuite";
|
|
3
|
+
import Assert from "./src/Assertions";
|
|
4
4
|
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
Test,
|
|
7
|
+
TestSuite,
|
|
8
|
+
Assert
|
|
9
9
|
};
|
package/.editorconfig
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
-
and orientation.
|
|
11
|
-
|
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
-
diverse, inclusive, and healthy community.
|
|
14
|
-
|
|
15
|
-
## Our Standards
|
|
16
|
-
|
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
|
18
|
-
community include:
|
|
19
|
-
|
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
|
23
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
-
and learning from the experience
|
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
-
overall community
|
|
27
|
-
|
|
28
|
-
Examples of unacceptable behavior include:
|
|
29
|
-
|
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
-
advances of any kind
|
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
-
* Public or private harassment
|
|
34
|
-
* Publishing others' private information, such as a physical or email
|
|
35
|
-
address, without their explicit permission
|
|
36
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
-
professional setting
|
|
38
|
-
|
|
39
|
-
## Enforcement Responsibilities
|
|
40
|
-
|
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
-
or harmful.
|
|
45
|
-
|
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
-
decisions when appropriate.
|
|
50
|
-
|
|
51
|
-
## Scope
|
|
52
|
-
|
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
-
an individual is officially representing the community in public spaces.
|
|
55
|
-
Examples of representing our community include using an official e-mail address,
|
|
56
|
-
posting via an official social media account, or acting as an appointed
|
|
57
|
-
representative at an online or offline event.
|
|
58
|
-
|
|
59
|
-
## Enforcement
|
|
60
|
-
|
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
-
reported to the community leaders responsible for enforcement at
|
|
63
|
-
Steve@ecoAPM.com.
|
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
-
|
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
-
reporter of any incident.
|
|
68
|
-
|
|
69
|
-
## Enforcement Guidelines
|
|
70
|
-
|
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
-
|
|
74
|
-
### 1. Correction
|
|
75
|
-
|
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
-
unprofessional or unwelcome in the community.
|
|
78
|
-
|
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
|
82
|
-
|
|
83
|
-
### 2. Warning
|
|
84
|
-
|
|
85
|
-
**Community Impact**: A violation through a single incident or series
|
|
86
|
-
of actions.
|
|
87
|
-
|
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
-
like social media. Violating these terms may lead to a temporary or
|
|
93
|
-
permanent ban.
|
|
94
|
-
|
|
95
|
-
### 3. Temporary Ban
|
|
96
|
-
|
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
|
98
|
-
sustained inappropriate behavior.
|
|
99
|
-
|
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
-
communication with the community for a specified period of time. No public or
|
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
-
Violating these terms may lead to a permanent ban.
|
|
105
|
-
|
|
106
|
-
### 4. Permanent Ban
|
|
107
|
-
|
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
-
|
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
-
the community.
|
|
114
|
-
|
|
115
|
-
## Attribution
|
|
116
|
-
|
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
-
version 2.0, available at
|
|
119
|
-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
-
|
|
121
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
-
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
-
|
|
124
|
-
[homepage]: https://www.contributor-covenant.org
|
|
125
|
-
|
|
126
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
-
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
-
https://www.contributor-covenant.org/translations.
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# ecoAPM Contribution Guidelines
|
|
2
|
-
|
|
3
|
-
First of all, thank you for your interest in contributing!
|
|
4
|
-
|
|
5
|
-
This document represents a general set of guidelines to help make the process of community contributions as smooth as possible for all parties involved.
|
|
6
|
-
|
|
7
|
-
#### Please read the [Code of Conduct](CODE_OF_CONDUCT.md) prior to participating
|
|
8
|
-
- This is the standard "Contributor Covenant" used throughout all ecoAPM codebases, and widely across the OSS landscape
|
|
9
|
-
- Building a strong, professional, caring, and empathetic community is paramount in our goal as an OSS company
|
|
10
|
-
|
|
11
|
-
#### Discussions about changes should happen in an issue before creating a pull request
|
|
12
|
-
- While a change may make sense for a specific use case, it may not match the larger goals of the project as initially formulated by the original contributor
|
|
13
|
-
- Prior discussion can help give direction to how a feature or bug fix could best be implemented to meet everyone's needs
|
|
14
|
-
|
|
15
|
-
#### Follow the standard issue template formats for reporting bugs and requesting new features
|
|
16
|
-
- These make reading, understanding, and triaging issues much easier
|
|
17
|
-
|
|
18
|
-
#### Commit quality code with detailed documentation to help maximize PR review effectiveness
|
|
19
|
-
- All new or modified functionality should have unit tests covering the logic involved
|
|
20
|
-
- All PR checks (e.g. automated tests, code quality analysis, etc.) should be passing before a PR is reviewed
|
|
21
|
-
- Commit messages should be English (Canadian/UK/US are all acceptable) in the present tense using an imperative form (see existing commits for examples)
|
|
22
|
-
- Please do not reference GitHub issue numbers or PR numbers in git commit messages
|
|
23
|
-
|
|
24
|
-
#### Multiple smaller, atomic PRs are preferable to single larger monolithic PRs
|
|
25
|
-
- This may take longer to get the full changeset merged, but will provide for a much smoother feedback process
|
|
26
|
-
- Please reference any related issue numbers in the body of all PR descriptions so that GitHub links them together
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 ecoAPM
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|