Skip to content

Commit

Permalink
feat: add test suites name
Browse files Browse the repository at this point in the history
  • Loading branch information
AnWeber committed Oct 31, 2023
1 parent 208647b commit b74184d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cli/send/junitUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('transformToJunit', () => {
expect(result).toBe(
`
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" errors="0" disabled="0" failues="0" time="1.001">
<testsuites name="httpyac" tests="1" errors="0" disabled="0" failues="0" time="1.001">
<testsuite name="test.http" tests="1" failures="0" skipped="0" package="." time="1.001" file="test.http">
<testcase name="test" classname="test.http" assertions="1" time="1.001"/>
</testsuite>
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('transformToJunit', () => {
expect(result).toBe(
`
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" errors="0" disabled="0" failues="0" time="3.005">
<testsuites name="httpyac" tests="1" errors="0" disabled="0" failues="0" time="3.005">
<testsuite name="test.http" tests="2" failures="0" skipped="0" package="." time="2.003" file="test.http">
<testcase name="test" classname="test.http" assertions="1" time="1.001"/>
<testcase name="test2" classname="test.http" assertions="1" time="1.002"/>
Expand Down Expand Up @@ -137,7 +137,7 @@ describe('transformToJunit', () => {
expect(result).toBe(
`
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" errors="0" disabled="1" failues="0" time="0.000">
<testsuites name="httpyac" tests="1" errors="0" disabled="1" failues="0" time="0.000">
<testsuite name="test.http" tests="1" failures="0" skipped="1" package="." time="0.000" file="test.http">
<testcase name="test" classname="test.http" assertions="0" time="0.000">
<skipped/>
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('transformToJunit', () => {
expect(result).toBe(
`
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" errors="0" disabled="0" failues="1" time="0.000">
<testsuites name="httpyac" tests="1" errors="0" disabled="0" failues="1" time="0.000">
<testsuite name="test.http" tests="1" failures="1" skipped="0" package="." time="0.000" file="test.http">
<testcase name="test" classname="test.http" assertions="2" time="0.000">
<failure message="Assertions fail" type="unknown">failed result</failure>
Expand Down Expand Up @@ -232,7 +232,7 @@ describe('transformToJunit', () => {
expect(result).toBe(
`
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" errors="0" disabled="0" failues="0" time="1.001">
<testsuites name="httpyac" tests="1" errors="0" disabled="0" failues="0" time="1.001">
<testsuite name="test.http" tests="1" failures="0" skipped="0" package="." time="1.001" file="test.http">
<testcase name="test" classname="test.http" assertions="1" time="1.001">
<properties>
Expand Down
1 change: 1 addition & 0 deletions src/cli/send/junitUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function transformToJunit(output: SendJsonOutput): string {
document.appendChild(xmlNode);
const root = document.createElement('testsuites');
document.appendChild(root);
root.setAttribute('name', `httpyac`);
root.setAttribute('tests', `${output.summary.totalRequests}`);
root.setAttribute('errors', '0');
root.setAttribute('disabled', `${output.summary.disabledRequests}`);
Expand Down

0 comments on commit b74184d

Please sign in to comment.