Skip to content

Commit dfaec0e

Browse files
committed
add empty fixture, fix js impl
1 parent 1c162eb commit dfaec0e

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

javascript/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export default {
4949
failureElement.cdata(testCase.failure.stack)
5050
}
5151
}
52-
testcaseElement.ele('system-out').cdata(testCase.output)
52+
if (testCase.output) {
53+
testcaseElement.ele('system-out').cdata(testCase.output)
54+
}
5355
}
5456

5557
write(builder.end({ pretty: true }))

javascript/src/makeReport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function makeReport(query: Query): ReportSuite {
4545
const statuses = query.countMostSevereTestStepResultStatus()
4646
return {
4747
time: durationToSeconds(query.findTestRunDuration()),
48-
tests: countStatuses(statuses),
48+
tests: query.countTestCasesStarted(),
4949
skipped: countStatuses(statuses, (status) => status === TestStepResultStatus.SKIPPED),
5050
failures: countStatuses(
5151
statuses,

testdata/empty.feature.ndjson

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{"meta":{"ci":{"buildNumber":"154666429","git":{"remote":"https://github.com/cucumber-ltd/shouty.rb.git","revision":"99684bcacf01d95875834d87903dcb072306c9ad"},"name":"GitHub Actions","url":"https://github.com/cucumber-ltd/shouty.rb/actions/runs/154666429"},"cpu":{"name":"x64"},"implementation":{"name":"fake-cucumber","version":"18.0.0"},"os":{"name":"darwin","version":"23.6.0"},"protocolVersion":"27.0.0","runtime":{"name":"node.js","version":"22.7.0"}}}
2+
{"source":{"data":"Feature: Empty Scenarios\n Sometimes we want to quickly jot down a new scenario without specifying any actual steps\n for what should be executed.\n\n In this instance we want to stipulate what should / shouldn't run and what the output is\n\n Scenario: Blank Scenario\n","mediaType":"text/x.cucumber.gherkin+plain","uri":"samples/empty/empty.feature"}}
3+
{"gherkinDocument":{"comments":[],"feature":{"children":[{"scenario":{"description":"","examples":[],"id":"0","keyword":"Scenario","location":{"column":3,"line":7},"name":"Blank Scenario","steps":[],"tags":[]}}],"description":" Sometimes we want to quickly jot down a new scenario without specifying any actual steps\n for what should be executed.\n\n In this instance we want to stipulate what should / shouldn't run and what the output is","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Empty Scenarios","tags":[]},"uri":"samples/empty/empty.feature"}}
4+
{"pickle":{"astNodeIds":["0"],"id":"1","language":"en","name":"Blank Scenario","steps":[],"tags":[],"uri":"samples/empty/empty.feature"}}
5+
{"testRunStarted":{"id":"2","timestamp":{"nanos":0,"seconds":0}}}
6+
{"testCase":{"id":"3","pickleId":"1","testRunStartedId":"2","testSteps":[]}}
7+
{"testCaseStarted":{"attempt":0,"id":"4","testCaseId":"3","timestamp":{"nanos":1000000,"seconds":0}}}
8+
{"testCaseFinished":{"testCaseStartedId":"4","timestamp":{"nanos":2000000,"seconds":0},"willBeRetried":false}}
9+
{"testRunFinished":{"success":true,"testRunStartedId":"2","timestamp":{"nanos":3000000,"seconds":0}}}

testdata/empty.feature.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuite name="Cucumber" time="0.003" tests="1" skipped="0" failures="0" errors="0">
3+
<testcase classname="Empty Scenarios" name="Blank Scenario" time="0.001">
4+
</testcase>
5+
</testsuite>

0 commit comments

Comments
 (0)