Skip to content

Commit

Permalink
Stray fixes in Java and JS (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgoss authored Nov 14, 2024
1 parent bb6aef0 commit 6615cb1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- [Java] `countTestCasesStarted` now accounts for retried test cases ([#65](https://github.com/cucumber/query/pull/65))
- [JavaScript] `Lineage` and related symbols now exported on entry point ([#65](https://github.com/cucumber/query/pull/65))

## [13.0.0] - 2024-11-14
### Added
Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@ status of a step, a scenario or an entire file.
| `getDocumentResults(uri: string): messages.ITestResult[]` | | | | ||
| `getStepMatchArguments(uri: string, lineNumber: number): messages.IStepMatchArgument[]` | | | | ||
| `getGherkinStep(gherkinStepId: string): messages.GherkinDocument.Feature.IStep` | | | | ||
| `countMostSevereTestStepResultStatus(): Map<TestStepResultStatus, Long>` | | || | |
| `countTestCasesStarted(): int` | | || | |
| `findAllPickles(): List<Pickle>` | | || | |
| `findAllPickleSteps(): List<PickleStep>` | | || | |
| `findAllTestCaseStarted(): List<TestCaseStarted> | | || | |
| `findAllTestCaseStartedGroupedByFeature(): Map<Optional<Feature>, List<TestCaseStarted>>` | | || | |
| `findAllTestSteps(): List<TestStep>` | | || | |
| `findFeatureBy(TestCaseStarted): Optional<Feature>` | | || | |
| `findMostSevereTestStepResulBy(TestCaseStarted): Optional<TestStepResult>` | | || | |
| `findNameOf(Pickle, NamingStrategy): String` | | || | |
| `findPickleBy(TestCaseStarted): Optional<Pickle>` | | || | |
| `findPickleStepBy(TestStep testStep): Optional<PickleStep>` | | || | |
| `findStepBy(PickleStep pickleStep): Optional<Step>` | | || | |
| `findTestCaseBy(TestCaseStarted): Optional<TestCase>` | | || | |
| `findTestCaseDurationBy(TestCaseStarted): Optional<Duration>` | | || | |
| `findTestCaseFinishedBy(TestCaseStarted): Optional<TestCaseFinished>` | | || | |
| `findTestRunDuration(): Optional<Duration>` | | || | |
| `findTestRunFinished(): Optional<TestRunFinished>` | | || | |
| `findTestRunStarted(): Optional<TestRunStarted>` | | || | |
| `findTestStepBy(TestStepFinished): Optional<TestStep>` | | || | |
| `findTestStepsFinishedBy(TestCaseStarted): List<TestStepFinished>` | | || | |
| `findTestStepFinishedAndTestStepBy(TestCaseStarted): List<Entry<TestStepFinished, TestStep>>` | | || | |
| `countMostSevereTestStepResultStatus(): Map<TestStepResultStatus, Long>` | | || | |
| `countTestCasesStarted(): int` | | || | |
| `findAllPickles(): List<Pickle>` | | || | |
| `findAllPickleSteps(): List<PickleStep>` | | || | |
| `findAllTestCaseStarted(): List<TestCaseStarted>` | | || | |
| `findAllTestCaseStartedGroupedByFeature(): Map<Optional<Feature>, List<TestCaseStarted>>` | | || | |
| `findAllTestSteps(): List<TestStep>` | | || | |
| `findFeatureBy(TestCaseStarted): Optional<Feature>` | | || | |
| `findMostSevereTestStepResulBy(TestCaseStarted): Optional<TestStepResult>` | | || | |
| `findNameOf(Pickle, NamingStrategy): String` | | || | |
| `findPickleBy(TestCaseStarted): Optional<Pickle>` | | || | |
| `findPickleStepBy(TestStep testStep): Optional<PickleStep>` | | || | |
| `findStepBy(PickleStep pickleStep): Optional<Step>` | | || | |
| `findTestCaseBy(TestCaseStarted): Optional<TestCase>` | | || | |
| `findTestCaseDurationBy(TestCaseStarted): Optional<Duration>` | | || | |
| `findTestCaseFinishedBy(TestCaseStarted): Optional<TestCaseFinished>` | | || | |
| `findTestRunDuration(): Optional<Duration>` | | || | |
| `findTestRunFinished(): Optional<TestRunFinished>` | | || | |
| `findTestRunStarted(): Optional<TestRunStarted>` | | || | |
| `findTestStepBy(TestStepFinished): Optional<TestStep>` | | || | |
| `findTestStepsFinishedBy(TestCaseStarted): List<TestStepFinished>` | | || | |
| `findTestStepFinishedAndTestStepBy(TestCaseStarted): List<Entry<TestStepFinished, TestStep>>` | | || | |
4 changes: 2 additions & 2 deletions java/src/main/java/io/cucumber/query/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public EnumMap<TestStepResultStatus, Long> countMostSevereTestStepResultStatus()
}

public int countTestCasesStarted() {
return testCaseStarted.size();
return findAllTestCaseStarted().size();
}

public List<Pickle> findAllPickles() {
Expand Down Expand Up @@ -257,7 +257,7 @@ public Optional<Pickle> findPickleBy(TestCaseStarted testCaseStarted) {
}

public Optional<PickleStep> findPickleStepBy(TestStep testStep) {
requireNonNull(testCaseStarted);
requireNonNull(testStep);
return testStep.getPickleStepId()
.map(pickleStepById::get);
}
Expand Down
1 change: 1 addition & 0 deletions java/src/test/java/io/cucumber/query/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void omitsTestCaseStartedIfFinishedAndWillBeRetried() {
.forEach(query::update);

assertThat(query.findAllTestCaseStarted()).containsExactly(c);
assertThat(query.countTestCasesStarted()).isEqualTo(1);
}

private static String randomId() {
Expand Down
2 changes: 2 additions & 0 deletions javascript/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import Query from './Query'
export * from './Lineage'

export { Query }

0 comments on commit 6615cb1

Please sign in to comment.