Skip to content

Commit 0d910f6

Browse files
committed
Initial Typescript conversion
- initial conversion done using GitHub Copilot Claude Haiku 4.5 for initial conversion - separated src, lib and xslt folders - updating package dependencies
1 parent f2a908b commit 0d910f6

32 files changed

+1413
-759
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
node_modules/
22

33
coverage.json
4-
lib/
54
coverage/
65
publish/
76
.idea/workspace.xml

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
node_modules/
22

33
coverage.json
4-
lib/
54
coverage/
65
publish/
76
*.tgz

bin/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
const yargs = require('yargs');
44
const { yargsOptions } = require('./options');
55
const { hideBin } = require('yargs/helpers');
6-
const { config } = require('../src/config');
7-
const convert = require('../src/converter');
6+
const { config } = require('../lib/config');
7+
const convert = require('../lib/converter');
88

99
const argv = yargs(hideBin(process.argv))
1010
.usage('Usage: $0 [options]')

index.d.ts

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,40 @@ declare module 'junit-converter'{
1414
}
1515

1616
/**
17-
* Convert test report to JUnit XML and write to file.
17+
* Test suite JSON representation
18+
*/
19+
interface TestSuite {
20+
name: string;
21+
tests: string;
22+
failures: string;
23+
skipped: string;
24+
time: string;
25+
testcase: TestCase[];
26+
file?: string;
27+
}
28+
/**
29+
* Test case JSON representation
30+
*/
31+
interface TestCase {
32+
classname: string;
33+
name: string;
34+
time: number;
35+
status?: string;
36+
[key: string]: any;
37+
}
38+
/**
39+
* Test suites JSON structure
40+
*/
41+
interface TestSuites {
42+
testsuites: Array<{
43+
time?: string | number;
44+
testsuite: TestSuite[];
45+
}>;
46+
}
47+
48+
49+
/**
50+
* Convert test report to JUnit XML and write to file async.
1851
*
1952
* @param {TestReportConverterOptions} options
2053
* @return {Promise<void>}
@@ -30,12 +63,12 @@ declare module 'junit-converter'{
3063
function toString(options: TestReportConverterOptions): Promise<string>;
3164

3265
/**
33-
* Convert test report to JUnit JSON object.
66+
* Convert test report to JUnit XML and parse as JSON object.
3467
*
3568
* @param {TestReportConverterOptions} options
3669
* @return {Promise<object>}
3770
*/
38-
function toJson(options: TestReportConverterOptions): Promise<object>;
71+
function toJson(options: TestReportConverterOptions): Promise<TestSuites>;
3972
}
4073

4174

lib/config.js

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/converter.js

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/converter.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/interfaces.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)