Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
**Junit CTRF Test Reporter v0.0.12**
**Junit CTRF Test Reporter v0.0.14**

***

# Junit CTRF Test Reporter v0.0.12
# Junit CTRF Test Reporter v0.0.14

## Interfaces

Expand Down
2 changes: 1 addition & 1 deletion docs/functions/convertJUnitToCTRFReport.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**Junit CTRF Test Reporter v0.0.12**](../README.md)
[**Junit CTRF Test Reporter v0.0.14**](../README.md)

***

Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/ConvertOptions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**Junit CTRF Test Reporter v0.0.12**](../README.md)
[**Junit CTRF Test Reporter v0.0.14**](../README.md)

***

Expand Down
166 changes: 154 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "junit-to-ctrf",
"version": "0.0.13",
"version": "0.0.14",
"description": "Convert JUnit XML reports to CTRF JSON",
"type": "module",
"main": "dist/index.js",
Expand All @@ -16,6 +16,7 @@
"format": "prettier --write .",
"format:check": "prettier --check .",
"e2e:junit": "node dist/cli.js reports/test-junit.xml --output reports/test-junit-ctrf.json",
"e2e:junit-nested": "node dist/cli.js reports/test-junit-nested.xml --output reports/test-junit-nested-ctrf.json",
"e2e:minitest": "node dist/cli.js reports/test-minitest-junit.xml --output reports/test-minitest-junit-ctrf.json",
"e2e:surefire": "node dist/cli.js reports/test-surefire.xml --output reports/test-surefire-ctrf.json",
"e2e:glob": "node dist/cli.js \"reports/*.xml\" --output reports/test-glob-ctrf.json",
Expand Down Expand Up @@ -48,7 +49,7 @@
"homepage": "https://ctrf.io",
"license": "MIT",
"dependencies": {
"ctrf": "^0.0.13",
"ctrf": "^0.0.17",
"fs-extra": "^11.3.0",
"glob": "^11.0.3",
"typescript": "^5.8.3",
Expand Down
36 changes: 36 additions & 0 deletions reports/test-junit-nested.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="com.example.AllTests" tests="10" failures="1" errors="1" skipped="1" time="1.550">
<testsuite name="com.example.UnitTests" tests="6" failures="1" errors="1" skipped="1" time="0.350">
<testcase name="testAddition" classname="com.example.UnitTests" time="0.015"/>
<testcase name="testSubtraction" classname="com.example.UnitTests" time="0.010"/>
<testcase name="testMultiplication" classname="com.example.UnitTests" time="0.020">
<failure message="Expected 10 but was 9" type="AssertionError">
Stack trace details...
</failure>
</testcase>
<testcase name="testDivision" classname="com.example.UnitTests" time="0.000">
<skipped/>
</testcase>
<testcase name="testModulo" classname="com.example.UnitTests" time="0.005">
<error message="NullPointerException occurred" type="java.lang.NullPointerException">
Stack trace details...
</error>
</testcase>
<testcase name="testSquareRoot" classname="com.example.UnitTests" time="0.300"/>
<system-out><![CDATA[Standard output logs for UnitTests]]></system-out>
<system-err><![CDATA[Standard error logs for UnitTests]]></system-err>
</testsuite>
<testsuite name="com.example.IntegrationTests" tests="4" failures="0" errors="0" skipped="0" time="1.200">
<testcase name="testUserLogin" classname="com.example.IntegrationTests" time="0.400"/>
<testcase name="testUserRegistration" classname="com.example.IntegrationTests" time="0.300"/>
<testcase name="testProductSearch" classname="com.example.IntegrationTests" time="0.200"/>
<testcase name="testCheckoutProcess" classname="com.example.IntegrationTests" time="0.300"/>
<system-out><![CDATA[Integration test logs...]]></system-out>
<system-err><![CDATA[Integration test error logs...]]></system-err>
</testsuite>
<system-out><![CDATA[Standard output logs for AllTests suite]]></system-out>
<system-err><![CDATA[Standard error logs for AllTests suite]]></system-err>
</testsuite>
</testsuites>

10 changes: 5 additions & 5 deletions src/convert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('createCTRFReport', () => {
duration: 500,
filePath: 'test1.js',
line: 10,
suite: 'TestSuite1',
suite: ['TestSuite1'],
}),
expect.objectContaining({
name: 'testFailed',
Expand All @@ -95,15 +95,15 @@ describe('createCTRFReport', () => {
line: 15,
message: 'Test failed',
trace: 'Error: Test failed\n at testFailed (test1.js:15:5)',
suite: 'TestSuite1',
suite: ['TestSuite1'],
}),
expect.objectContaining({
name: 'testSkipped',
status: 'skipped',
duration: 100,
filePath: 'test2.js',
line: 20,
suite: 'TestSuite2',
suite: ['TestSuite2'],
}),
]),
},
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('createCTRFReport', () => {
line: undefined,
message: undefined,
trace: undefined,
suite: 'TestSuite',
suite: ['TestSuite'],
}),
])
})
Expand Down Expand Up @@ -246,7 +246,7 @@ describe('createCTRFReport', () => {
message: 'Cannot read property of undefined',
trace:
'TypeError: Cannot read property of undefined\n at testWithError (test.js:25:10)',
suite: 'TestSuite',
suite: ['TestSuite'],
}),
])
})
Expand Down
Loading