@cucumber/react-components 24.1.2 → 24.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/src/CucumberQueryContext.d.ts +1 -2
- package/dist/src/CucumberQueryContext.d.ts.map +1 -1
- package/dist/src/CucumberQueryContext.js +2 -2
- package/dist/src/CucumberQueryContext.js.map +1 -1
- package/dist/src/GherkinQueryContext.d.ts +1 -2
- package/dist/src/GherkinQueryContext.d.ts.map +1 -1
- package/dist/src/GherkinQueryContext.js +2 -2
- package/dist/src/GherkinQueryContext.js.map +1 -1
- package/dist/src/SearchContext.d.ts +11 -5
- package/dist/src/SearchContext.d.ts.map +1 -1
- package/dist/src/SearchContext.js +4 -2
- package/dist/src/SearchContext.js.map +1 -1
- package/dist/src/ciCommitLink.d.ts +1 -1
- package/dist/src/ciCommitLink.d.ts.map +1 -1
- package/dist/src/ciCommitLink.js +1 -1
- package/dist/src/ciCommitLink.js.map +1 -1
- package/dist/src/components/app/CICommitLink.d.ts +2 -2
- package/dist/src/components/app/CICommitLink.d.ts.map +1 -1
- package/dist/src/components/app/CICommitLink.js +3 -8
- package/dist/src/components/app/CICommitLink.js.map +1 -1
- package/dist/src/components/app/CIJobLink.d.ts +2 -2
- package/dist/src/components/app/CIJobLink.d.ts.map +1 -1
- package/dist/src/components/app/CIJobLink.js +3 -7
- package/dist/src/components/app/CIJobLink.js.map +1 -1
- package/dist/src/components/app/ControlledSearchProvider.d.ts +2 -2
- package/dist/src/components/app/ControlledSearchProvider.d.ts.map +1 -1
- package/dist/src/components/app/ControlledSearchProvider.js +24 -2
- package/dist/src/components/app/ControlledSearchProvider.js.map +1 -1
- package/dist/src/components/app/CopyButton.d.ts +2 -1
- package/dist/src/components/app/CopyButton.d.ts.map +1 -1
- package/dist/src/components/app/CopyButton.js +4 -4
- package/dist/src/components/app/CopyButton.js.map +1 -1
- package/dist/src/components/app/DocumentAccordion.d.ts +3 -3
- package/dist/src/components/app/DocumentAccordion.d.ts.map +1 -1
- package/dist/src/components/app/DocumentAccordion.js +12 -20
- package/dist/src/components/app/DocumentAccordion.js.map +1 -1
- package/dist/src/components/app/DocumentAccordion.module.scss +15 -7
- package/dist/src/components/app/EnvelopesProvider.d.ts +2 -2
- package/dist/src/components/app/EnvelopesProvider.d.ts.map +1 -1
- package/dist/src/components/app/EnvelopesProvider.js +3 -2
- package/dist/src/components/app/EnvelopesProvider.js.map +1 -1
- package/dist/src/components/app/ExecutionSummary.d.ts +1 -1
- package/dist/src/components/app/ExecutionSummary.d.ts.map +1 -1
- package/dist/src/components/app/ExecutionSummary.js +3 -49
- package/dist/src/components/app/ExecutionSummary.js.map +1 -1
- package/dist/src/components/app/FilteredDocuments.d.ts +1 -1
- package/dist/src/components/app/FilteredDocuments.d.ts.map +1 -1
- package/dist/src/components/app/FilteredDocuments.js +4 -4
- package/dist/src/components/app/FilteredDocuments.js.map +1 -1
- package/dist/src/components/app/GherkinDocumentList.d.ts +3 -3
- package/dist/src/components/app/GherkinDocumentList.d.ts.map +1 -1
- package/dist/src/components/app/GherkinDocumentList.js +8 -9
- package/dist/src/components/app/GherkinDocumentList.js.map +1 -1
- package/dist/src/components/app/Header.d.ts +1 -1
- package/dist/src/components/app/Header.d.ts.map +1 -1
- package/dist/src/components/app/Header.js +4 -4
- package/dist/src/components/app/Header.js.map +1 -1
- package/dist/src/components/app/HealthChart.d.ts +1 -1
- package/dist/src/components/app/HealthChart.d.ts.map +1 -1
- package/dist/src/components/app/HealthChart.js +6 -7
- package/dist/src/components/app/HealthChart.js.map +1 -1
- package/dist/src/components/app/HighLight.d.ts +2 -2
- package/dist/src/components/app/HighLight.d.ts.map +1 -1
- package/dist/src/components/app/HighLight.js +15 -9
- package/dist/src/components/app/HighLight.js.map +1 -1
- package/dist/src/components/app/ImplementationIcon.d.ts +2 -2
- package/dist/src/components/app/ImplementationIcon.d.ts.map +1 -1
- package/dist/src/components/app/ImplementationIcon.js +2 -2
- package/dist/src/components/app/ImplementationIcon.js.map +1 -1
- package/dist/src/components/app/InMemorySearchProvider.d.ts +2 -2
- package/dist/src/components/app/InMemorySearchProvider.d.ts.map +1 -1
- package/dist/src/components/app/InMemorySearchProvider.js +3 -2
- package/dist/src/components/app/InMemorySearchProvider.js.map +1 -1
- package/dist/src/components/app/NavigationButton.d.ts +1 -1
- package/dist/src/components/app/NavigationButton.d.ts.map +1 -1
- package/dist/src/components/app/NavigationButton.js +2 -2
- package/dist/src/components/app/NavigationButton.js.map +1 -1
- package/dist/src/components/app/OSIcon.d.ts +2 -2
- package/dist/src/components/app/OSIcon.d.ts.map +1 -1
- package/dist/src/components/app/OSIcon.js +4 -4
- package/dist/src/components/app/OSIcon.js.map +1 -1
- package/dist/src/components/app/QueriesProvider.d.ts +3 -3
- package/dist/src/components/app/QueriesProvider.d.ts.map +1 -1
- package/dist/src/components/app/QueriesProvider.js +4 -3
- package/dist/src/components/app/QueriesProvider.js.map +1 -1
- package/dist/src/components/app/Report.d.ts +1 -1
- package/dist/src/components/app/Report.d.ts.map +1 -1
- package/dist/src/components/app/Report.js +2 -11
- package/dist/src/components/app/Report.js.map +1 -1
- package/dist/src/components/app/RuntimeIcon.d.ts +2 -2
- package/dist/src/components/app/RuntimeIcon.d.ts.map +1 -1
- package/dist/src/components/app/RuntimeIcon.js +4 -4
- package/dist/src/components/app/RuntimeIcon.js.map +1 -1
- package/dist/src/components/app/SearchBar.d.ts +1 -1
- package/dist/src/components/app/SearchBar.d.ts.map +1 -1
- package/dist/src/components/app/SearchBar.js +9 -24
- package/dist/src/components/app/SearchBar.js.map +1 -1
- package/dist/src/components/app/StatusesSummary.d.ts +1 -1
- package/dist/src/components/app/StatusesSummary.d.ts.map +1 -1
- package/dist/src/components/app/StatusesSummary.js +8 -11
- package/dist/src/components/app/StatusesSummary.js.map +1 -1
- package/dist/src/components/app/TestRunHooks.d.ts +1 -1
- package/dist/src/components/app/TestRunHooks.d.ts.map +1 -1
- package/dist/src/components/app/TestRunHooks.js +5 -5
- package/dist/src/components/app/TestRunHooks.js.map +1 -1
- package/dist/src/components/app/UrlSearchProvider.d.ts +1 -1
- package/dist/src/components/app/UrlSearchProvider.d.ts.map +1 -1
- package/dist/src/components/app/UrlSearchProvider.js +6 -3
- package/dist/src/components/app/UrlSearchProvider.js.map +1 -1
- package/dist/src/components/app/icons/CucumberLogo.d.ts +1 -1
- package/dist/src/components/app/icons/CucumberLogo.d.ts.map +1 -1
- package/dist/src/components/app/icons/CucumberLogo.js +2 -6
- package/dist/src/components/app/icons/CucumberLogo.js.map +1 -1
- package/dist/src/components/app/icons/Jvm.d.ts +1 -1
- package/dist/src/components/app/icons/Jvm.d.ts.map +1 -1
- package/dist/src/components/app/icons/Jvm.js +2 -7
- package/dist/src/components/app/icons/Jvm.js.map +1 -1
- package/dist/src/components/app/icons/Linux.d.ts +1 -1
- package/dist/src/components/app/icons/Linux.d.ts.map +1 -1
- package/dist/src/components/app/icons/Linux.js +2 -17
- package/dist/src/components/app/icons/Linux.js.map +1 -1
- package/dist/src/components/app/icons/MacOS.d.ts +1 -1
- package/dist/src/components/app/icons/MacOS.d.ts.map +1 -1
- package/dist/src/components/app/icons/MacOS.js +2 -3
- package/dist/src/components/app/icons/MacOS.js.map +1 -1
- package/dist/src/components/app/icons/NodeJs.d.ts +1 -1
- package/dist/src/components/app/icons/NodeJs.d.ts.map +1 -1
- package/dist/src/components/app/icons/NodeJs.js +2 -5
- package/dist/src/components/app/icons/NodeJs.js.map +1 -1
- package/dist/src/components/app/icons/Ruby.d.ts +1 -1
- package/dist/src/components/app/icons/Ruby.d.ts.map +1 -1
- package/dist/src/components/app/icons/Ruby.js +2 -3
- package/dist/src/components/app/icons/Ruby.js.map +1 -1
- package/dist/src/components/app/icons/Windows.d.ts +1 -1
- package/dist/src/components/app/icons/Windows.d.ts.map +1 -1
- package/dist/src/components/app/icons/Windows.js +2 -3
- package/dist/src/components/app/icons/Windows.js.map +1 -1
- package/dist/src/components/app/makeSetupString.d.ts +1 -1
- package/dist/src/components/app/makeSetupString.d.ts.map +1 -1
- package/dist/src/components/app/makeSetupString.js.map +1 -1
- package/dist/src/components/app/markdownComponents.d.ts +9 -0
- package/dist/src/components/app/markdownComponents.d.ts.map +1 -0
- package/dist/src/components/app/markdownComponents.js +6 -0
- package/dist/src/components/app/markdownComponents.js.map +1 -0
- package/dist/src/components/app/rehypePlugins.d.ts +2 -2
- package/dist/src/components/app/rehypePlugins.d.ts.map +1 -1
- package/dist/src/components/app/rehypePlugins.js.map +1 -1
- package/dist/src/components/app/remarkPlugins.d.ts +2 -2
- package/dist/src/components/app/remarkPlugins.d.ts.map +1 -1
- package/dist/src/components/app/remarkPlugins.js.map +1 -1
- package/dist/src/components/customise/CustomRendering.d.ts +18 -18
- package/dist/src/components/customise/CustomRendering.d.ts.map +1 -1
- package/dist/src/components/customise/CustomRendering.js +10 -9
- package/dist/src/components/customise/CustomRendering.js.map +1 -1
- package/dist/src/components/customise/CustomRendering.stories.scss +0 -17
- package/dist/src/components/gherkin/Anchor.d.ts +3 -3
- package/dist/src/components/gherkin/Anchor.d.ts.map +1 -1
- package/dist/src/components/gherkin/Anchor.js +3 -6
- package/dist/src/components/gherkin/Anchor.js.map +1 -1
- package/dist/src/components/gherkin/Background.d.ts +3 -3
- package/dist/src/components/gherkin/Background.d.ts.map +1 -1
- package/dist/src/components/gherkin/Background.js +4 -10
- package/dist/src/components/gherkin/Background.js.map +1 -1
- package/dist/src/components/gherkin/Children.d.ts +3 -3
- package/dist/src/components/gherkin/Children.d.ts.map +1 -1
- package/dist/src/components/gherkin/Children.js +3 -3
- package/dist/src/components/gherkin/Children.js.map +1 -1
- package/dist/src/components/gherkin/DataTable.d.ts +3 -3
- package/dist/src/components/gherkin/DataTable.d.ts.map +1 -1
- package/dist/src/components/gherkin/DataTable.js +4 -6
- package/dist/src/components/gherkin/DataTable.js.map +1 -1
- package/dist/src/components/gherkin/Description.d.ts +3 -3
- package/dist/src/components/gherkin/Description.d.ts.map +1 -1
- package/dist/src/components/gherkin/Description.js +3 -4
- package/dist/src/components/gherkin/Description.js.map +1 -1
- package/dist/src/components/gherkin/DocString.d.ts +3 -3
- package/dist/src/components/gherkin/DocString.d.ts.map +1 -1
- package/dist/src/components/gherkin/DocString.js +3 -4
- package/dist/src/components/gherkin/DocString.js.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.d.ts +2 -2
- package/dist/src/components/gherkin/ErrorMessage.d.ts.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.js +5 -3
- package/dist/src/components/gherkin/ErrorMessage.js.map +1 -1
- package/dist/src/components/gherkin/ErrorMessage.module.scss +17 -5
- package/dist/src/components/gherkin/Examples.d.ts +3 -3
- package/dist/src/components/gherkin/Examples.d.ts.map +1 -1
- package/dist/src/components/gherkin/Examples.js +7 -18
- package/dist/src/components/gherkin/Examples.js.map +1 -1
- package/dist/src/components/gherkin/Feature.d.ts +3 -3
- package/dist/src/components/gherkin/Feature.d.ts.map +1 -1
- package/dist/src/components/gherkin/Feature.js +14 -24
- package/dist/src/components/gherkin/Feature.js.map +1 -1
- package/dist/src/components/gherkin/GherkinDocument.d.ts +3 -3
- package/dist/src/components/gherkin/GherkinDocument.d.ts.map +1 -1
- package/dist/src/components/gherkin/GherkinDocument.js +3 -3
- package/dist/src/components/gherkin/GherkinDocument.js.map +1 -1
- package/dist/src/components/gherkin/Keyword.d.ts +2 -2
- package/dist/src/components/gherkin/Keyword.d.ts.map +1 -1
- package/dist/src/components/gherkin/Keyword.js +3 -3
- package/dist/src/components/gherkin/Keyword.js.map +1 -1
- package/dist/src/components/gherkin/Keyword.module.scss +0 -1
- package/dist/src/components/gherkin/Parameter.d.ts +3 -3
- package/dist/src/components/gherkin/Parameter.d.ts.map +1 -1
- package/dist/src/components/gherkin/Parameter.js +4 -4
- package/dist/src/components/gherkin/Parameter.js.map +1 -1
- package/dist/src/components/gherkin/Rule.d.ts +3 -3
- package/dist/src/components/gherkin/Rule.d.ts.map +1 -1
- package/dist/src/components/gherkin/Rule.js +11 -21
- package/dist/src/components/gherkin/Rule.js.map +1 -1
- package/dist/src/components/gherkin/Scenario.d.ts +3 -3
- package/dist/src/components/gherkin/Scenario.d.ts.map +1 -1
- package/dist/src/components/gherkin/Scenario.js +5 -14
- package/dist/src/components/gherkin/Scenario.js.map +1 -1
- package/dist/src/components/gherkin/StatusIcon.d.ts +2 -2
- package/dist/src/components/gherkin/StatusIcon.d.ts.map +1 -1
- package/dist/src/components/gherkin/StatusIcon.js +10 -10
- package/dist/src/components/gherkin/StatusIcon.js.map +1 -1
- package/dist/src/components/gherkin/StepsList.d.ts +1 -1
- package/dist/src/components/gherkin/StepsList.d.ts.map +1 -1
- package/dist/src/components/gherkin/StepsList.js +2 -2
- package/dist/src/components/gherkin/StepsList.js.map +1 -1
- package/dist/src/components/gherkin/Tags.d.ts +3 -3
- package/dist/src/components/gherkin/Tags.d.ts.map +1 -1
- package/dist/src/components/gherkin/Tags.js +4 -5
- package/dist/src/components/gherkin/Tags.js.map +1 -1
- package/dist/src/components/gherkin/Title.d.ts +3 -3
- package/dist/src/components/gherkin/Title.d.ts.map +1 -1
- package/dist/src/components/gherkin/Title.js +3 -4
- package/dist/src/components/gherkin/Title.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Attachment.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Attachment.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Attachment.js +14 -17
- package/dist/src/components/gherkin/attachment/Attachment.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Attachment.module.scss +15 -5
- package/dist/src/components/gherkin/attachment/Image.d.ts +4 -4
- package/dist/src/components/gherkin/attachment/Image.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Image.js +6 -8
- package/dist/src/components/gherkin/attachment/Image.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Links.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Links.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Links.js +7 -10
- package/dist/src/components/gherkin/attachment/Links.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Log.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Log.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Log.js +3 -3
- package/dist/src/components/gherkin/attachment/Log.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Text.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Text.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Text.js +4 -6
- package/dist/src/components/gherkin/attachment/Text.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Unknown.d.ts +2 -2
- package/dist/src/components/gherkin/attachment/Unknown.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Unknown.js +9 -17
- package/dist/src/components/gherkin/attachment/Unknown.js.map +1 -1
- package/dist/src/components/gherkin/attachment/Video.d.ts +3 -3
- package/dist/src/components/gherkin/attachment/Video.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/Video.js +6 -10
- package/dist/src/components/gherkin/attachment/Video.js.map +1 -1
- package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts +1 -1
- package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/attachmentFilename.js.map +1 -1
- package/dist/src/components/gherkin/attachment/base64Decode.d.ts +9 -1
- package/dist/src/components/gherkin/attachment/base64Decode.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/base64Decode.js +17 -3
- package/dist/src/components/gherkin/attachment/base64Decode.js.map +1 -1
- package/dist/src/components/gherkin/attachment/useText.d.ts +1 -1
- package/dist/src/components/gherkin/attachment/useText.d.ts.map +1 -1
- package/dist/src/components/gherkin/attachment/useText.js +3 -3
- package/dist/src/components/gherkin/attachment/useText.js.map +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.d.ts +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.d.ts.map +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.js +1 -1
- package/dist/src/components/gherkin/composeHookStepTitle.js.map +1 -1
- package/dist/src/components/gherkin/composePickleStepTitle.d.ts +1 -1
- package/dist/src/components/gherkin/composePickleStepTitle.d.ts.map +1 -1
- package/dist/src/components/gherkin/composePickleStepTitle.js +2 -2
- package/dist/src/components/gherkin/composePickleStepTitle.js.map +1 -1
- package/dist/src/components/gherkin/statusName.d.ts +2 -2
- package/dist/src/components/gherkin/statusName.d.ts.map +1 -1
- package/dist/src/components/gherkin/statusName.js.map +1 -1
- package/dist/src/components/results/AmbiguousResult.d.ts +8 -0
- package/dist/src/components/results/AmbiguousResult.d.ts.map +1 -0
- package/dist/src/components/results/AmbiguousResult.js +11 -0
- package/dist/src/components/results/AmbiguousResult.js.map +1 -0
- package/dist/src/components/results/AmbiguousResult.module.scss +22 -0
- package/dist/src/components/results/FailedResult.d.ts +8 -0
- package/dist/src/components/results/FailedResult.d.ts.map +1 -0
- package/dist/src/components/results/FailedResult.js +15 -0
- package/dist/src/components/results/FailedResult.js.map +1 -0
- package/dist/src/components/results/PendingResult.d.ts +8 -0
- package/dist/src/components/results/PendingResult.d.ts.map +1 -0
- package/dist/src/components/results/PendingResult.js +12 -0
- package/dist/src/components/results/PendingResult.js.map +1 -0
- package/dist/src/components/results/ResultNote.d.ts +3 -0
- package/dist/src/components/results/ResultNote.d.ts.map +1 -0
- package/dist/src/components/results/ResultNote.js +6 -0
- package/dist/src/components/results/ResultNote.js.map +1 -0
- package/dist/src/components/results/ResultNote.module.scss +6 -0
- package/dist/src/components/results/SkippedResult.d.ts +8 -0
- package/dist/src/components/results/SkippedResult.d.ts.map +1 -0
- package/dist/src/components/results/SkippedResult.js +12 -0
- package/dist/src/components/results/SkippedResult.js.map +1 -0
- package/dist/src/components/results/SourceReference.d.ts +8 -0
- package/dist/src/components/results/SourceReference.d.ts.map +1 -0
- package/dist/src/components/results/SourceReference.js +13 -0
- package/dist/src/components/results/SourceReference.js.map +1 -0
- package/dist/src/components/results/SourceReference.module.scss +10 -0
- package/dist/src/components/results/TestCaseOutcome.d.ts +2 -2
- package/dist/src/components/results/TestCaseOutcome.d.ts.map +1 -1
- package/dist/src/components/results/TestCaseOutcome.js +5 -9
- package/dist/src/components/results/TestCaseOutcome.js.map +1 -1
- package/dist/src/components/results/TestRunHookOutcome.d.ts +2 -2
- package/dist/src/components/results/TestRunHookOutcome.d.ts.map +1 -1
- package/dist/src/components/results/TestRunHookOutcome.js +4 -13
- package/dist/src/components/results/TestRunHookOutcome.js.map +1 -1
- package/dist/src/components/results/TestStepAttachments.d.ts +2 -2
- package/dist/src/components/results/TestStepAttachments.d.ts.map +1 -1
- package/dist/src/components/results/TestStepAttachments.js +4 -5
- package/dist/src/components/results/TestStepAttachments.js.map +1 -1
- package/dist/src/components/results/TestStepDuration.d.ts +2 -2
- package/dist/src/components/results/TestStepDuration.d.ts.map +1 -1
- package/dist/src/components/results/TestStepDuration.js +4 -2
- package/dist/src/components/results/TestStepDuration.js.map +1 -1
- package/dist/src/components/results/TestStepOutcome.d.ts +2 -2
- package/dist/src/components/results/TestStepOutcome.d.ts.map +1 -1
- package/dist/src/components/results/TestStepOutcome.js +18 -27
- package/dist/src/components/results/TestStepOutcome.js.map +1 -1
- package/dist/src/components/results/TestStepOutcome.module.scss +1 -1
- package/dist/src/components/results/UndefinedResult.d.ts +8 -0
- package/dist/src/components/results/UndefinedResult.d.ts.map +1 -0
- package/dist/src/components/results/UndefinedResult.js +18 -0
- package/dist/src/components/results/UndefinedResult.js.map +1 -0
- package/dist/src/components/results/UndefinedResult.module.scss +14 -0
- package/dist/src/components/results/index.d.ts +1 -1
- package/dist/src/components/results/index.d.ts.map +1 -1
- package/dist/src/components/results/index.js +1 -1
- package/dist/src/components/results/index.js.map +1 -1
- package/dist/src/formatExecutionDuration.js.map +1 -1
- package/dist/src/hooks/helpers.js.map +1 -1
- package/dist/src/hooks/useFilteredDocuments.d.ts +2 -2
- package/dist/src/hooks/useFilteredDocuments.d.ts.map +1 -1
- package/dist/src/hooks/useFilteredDocuments.js +70 -18
- package/dist/src/hooks/useFilteredDocuments.js.map +1 -1
- package/dist/src/hooks/useMostSevereStatusByUri.js.map +1 -1
- package/dist/src/hooks/useQueries.d.ts +2 -2
- package/dist/src/hooks/useQueries.d.ts.map +1 -1
- package/dist/src/hooks/useQueries.js.map +1 -1
- package/dist/src/hooks/useResultStatistics.d.ts +3 -2
- package/dist/src/hooks/useResultStatistics.d.ts.map +1 -1
- package/dist/src/hooks/useResultStatistics.js +19 -2
- package/dist/src/hooks/useResultStatistics.js.map +1 -1
- package/dist/src/hooks/useSearch.d.ts +1 -1
- package/dist/src/hooks/useSearch.d.ts.map +1 -1
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/hooks/useTestCaseStarted.d.ts +6 -1
- package/dist/src/hooks/useTestCaseStarted.d.ts.map +1 -1
- package/dist/src/hooks/useTestCaseStarted.js +13 -10
- package/dist/src/hooks/useTestCaseStarted.js.map +1 -1
- package/dist/src/hooks/useTestRunHooks.d.ts +1 -1
- package/dist/src/hooks/useTestRunHooks.d.ts.map +1 -1
- package/dist/src/hooks/useTestRunHooks.js.map +1 -1
- package/dist/src/search/FeatureSearch.d.ts +12 -3
- package/dist/src/search/FeatureSearch.d.ts.map +1 -1
- package/dist/src/search/FeatureSearch.js +9 -17
- package/dist/src/search/FeatureSearch.js.map +1 -1
- package/dist/src/search/ScenarioLikeSearch.d.ts +8 -13
- package/dist/src/search/ScenarioLikeSearch.d.ts.map +1 -1
- package/dist/src/search/ScenarioLikeSearch.js +13 -17
- package/dist/src/search/ScenarioLikeSearch.js.map +1 -1
- package/dist/src/search/StepSearch.d.ts +9 -16
- package/dist/src/search/StepSearch.d.ts.map +1 -1
- package/dist/src/search/StepSearch.js +13 -17
- package/dist/src/search/StepSearch.js.map +1 -1
- package/dist/src/search/TextSearch.d.ts +11 -2
- package/dist/src/search/TextSearch.d.ts.map +1 -1
- package/dist/src/search/TextSearch.js +59 -52
- package/dist/src/search/TextSearch.js.map +1 -1
- package/dist/src/search/createSearchIndex.d.ts +7 -0
- package/dist/src/search/createSearchIndex.d.ts.map +1 -0
- package/dist/src/search/createSearchIndex.js +10 -0
- package/dist/src/search/createSearchIndex.js.map +1 -0
- package/dist/src/search/deriveLineageConstraints.d.ts +8 -0
- package/dist/src/search/deriveLineageConstraints.d.ts.map +1 -0
- package/dist/src/search/deriveLineageConstraints.js +38 -0
- package/dist/src/search/deriveLineageConstraints.js.map +1 -0
- package/dist/src/search/index.d.ts +3 -1
- package/dist/src/search/index.d.ts.map +1 -1
- package/dist/src/search/index.js +3 -1
- package/dist/src/search/index.js.map +1 -1
- package/dist/src/search/pruneGherkinDocuments.d.ts +24 -0
- package/dist/src/search/pruneGherkinDocuments.d.ts.map +1 -0
- package/dist/src/search/pruneGherkinDocuments.js +180 -0
- package/dist/src/search/pruneGherkinDocuments.js.map +1 -0
- package/dist/src/search/types.d.ts +39 -8
- package/dist/src/search/types.d.ts.map +1 -1
- package/dist/src/search/types.js +1 -1
- package/dist/src/search/types.js.map +1 -1
- package/dist/src/styles/statuses.scss +7 -13
- package/dist/src/toRepositoryId.d.ts +1 -1
- package/dist/src/toRepositoryId.d.ts.map +1 -1
- package/dist/src/toRepositoryId.js +7 -6
- package/dist/src/toRepositoryId.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +56 -71
- package/dist/src/components/results/TestStepResultDetails.d.ts +0 -4
- package/dist/src/components/results/TestStepResultDetails.d.ts.map +0 -1
- package/dist/src/components/results/TestStepResultDetails.js +0 -16
- package/dist/src/components/results/TestStepResultDetails.js.map +0 -1
- package/dist/src/countScenariosByStatuses.d.ts +0 -8
- package/dist/src/countScenariosByStatuses.d.ts.map +0 -1
- package/dist/src/countScenariosByStatuses.js +0 -22
- package/dist/src/countScenariosByStatuses.js.map +0 -1
- package/dist/src/filter/filterByStatus.d.ts +0 -5
- package/dist/src/filter/filterByStatus.d.ts.map +0 -1
- package/dist/src/filter/filterByStatus.js +0 -23
- package/dist/src/filter/filterByStatus.js.map +0 -1
- package/dist/src/search/Search.d.ts +0 -11
- package/dist/src/search/Search.d.ts.map +0 -1
- package/dist/src/search/Search.js +0 -46
- package/dist/src/search/Search.js.map +0 -1
- package/dist/src/search/TagSearch.d.ts +0 -4
- package/dist/src/search/TagSearch.d.ts.map +0 -1
- package/dist/src/search/TagSearch.js +0 -57
- package/dist/src/search/TagSearch.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cucumber/react-components",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.3.0",
|
|
4
4
|
"description": "React components for Cucumber",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -21,96 +21,81 @@
|
|
|
21
21
|
"start": "ladle serve",
|
|
22
22
|
"build": "ladle build",
|
|
23
23
|
"preview": "ladle preview",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"lint": "biome check --error-on-warnings",
|
|
25
|
+
"fix": "biome check --error-on-warnings --write",
|
|
26
26
|
"prepublishOnly": "npm run compile"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cucumber/gherkin-utils": "
|
|
30
|
-
"@cucumber/messages": "
|
|
31
|
-
"@cucumber/query": "
|
|
32
|
-
"@cucumber/tag-expressions": "
|
|
33
|
-
"@fortawesome/fontawesome-svg-core": "
|
|
34
|
-
"@fortawesome/free-solid-svg-icons": "
|
|
35
|
-
"@fortawesome/react-fontawesome": "
|
|
36
|
-
"@orama/orama": "^
|
|
37
|
-
"@orama/stemmers": "^
|
|
38
|
-
"@teppeis/multimaps": "
|
|
29
|
+
"@cucumber/gherkin-utils": "11.0.0",
|
|
30
|
+
"@cucumber/messages": "32.2.0",
|
|
31
|
+
"@cucumber/query": "15.0.1",
|
|
32
|
+
"@cucumber/tag-expressions": "9.1.0",
|
|
33
|
+
"@fortawesome/fontawesome-svg-core": "7.2.0",
|
|
34
|
+
"@fortawesome/free-solid-svg-icons": "7.2.0",
|
|
35
|
+
"@fortawesome/react-fontawesome": "3.3.0",
|
|
36
|
+
"@orama/orama": "^3.0.0",
|
|
37
|
+
"@orama/stemmers": "^3.0.0",
|
|
38
|
+
"@teppeis/multimaps": "3.0.0",
|
|
39
39
|
"ansi-to-html": "0.7.2",
|
|
40
|
-
"
|
|
41
|
-
"date-fns": "2.29.3",
|
|
40
|
+
"date-fns": "4.1.0",
|
|
42
41
|
"hast-util-sanitize": "^5.0.1",
|
|
43
|
-
"highlight-words": "1.2.
|
|
44
|
-
"mime": "^
|
|
45
|
-
"react-
|
|
46
|
-
"react-error-boundary": "^
|
|
47
|
-
"react-markdown": "
|
|
48
|
-
"rehype-raw": "
|
|
49
|
-
"rehype-sanitize": "
|
|
50
|
-
"remark-breaks": "
|
|
51
|
-
"remark-gfm": "
|
|
52
|
-
"use-debounce": "^10.0.0"
|
|
53
|
-
"uuid": "9.0.0"
|
|
42
|
+
"highlight-words-core": "1.2.3",
|
|
43
|
+
"mime": "^4.0.0",
|
|
44
|
+
"react-aria-components": "^1.16.0",
|
|
45
|
+
"react-error-boundary": "^6.0.0",
|
|
46
|
+
"react-markdown": "10.1.0",
|
|
47
|
+
"rehype-raw": "7.0.0",
|
|
48
|
+
"rehype-sanitize": "6.0.0",
|
|
49
|
+
"remark-breaks": "4.0.0",
|
|
50
|
+
"remark-gfm": "4.0.1",
|
|
51
|
+
"use-debounce": "^10.0.0"
|
|
54
52
|
},
|
|
55
53
|
"peerDependencies": {
|
|
56
|
-
"react": "
|
|
57
|
-
"react-dom": "
|
|
54
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
55
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
58
56
|
},
|
|
59
57
|
"devDependencies": {
|
|
60
|
-
"@
|
|
61
|
-
"@cucumber/
|
|
62
|
-
"@cucumber/
|
|
63
|
-
"@cucumber/gherkin
|
|
58
|
+
"@biomejs/biome": "^2.4.1",
|
|
59
|
+
"@cucumber/biome-config": "cucumber/biome-config#v0.1.0",
|
|
60
|
+
"@cucumber/compatibility-kit": "^29.0.0",
|
|
61
|
+
"@cucumber/gherkin": "^39.0.0",
|
|
64
62
|
"@cucumber/message-streams": "^4.0.1",
|
|
65
|
-
"@eslint/compat": "^1.2.7",
|
|
66
|
-
"@eslint/eslintrc": "^3.2.0",
|
|
67
|
-
"@eslint/js": "^9.20.0",
|
|
68
63
|
"@ladle/react": "^5.0.3",
|
|
69
|
-
"@testing-library/react": "
|
|
70
|
-
"@testing-library/user-event": "14.
|
|
71
|
-
"@types/chai": "^
|
|
64
|
+
"@testing-library/react": "16.3.2",
|
|
65
|
+
"@testing-library/user-event": "14.6.1",
|
|
66
|
+
"@types/chai": "^5.0.0",
|
|
72
67
|
"@types/chai-dom": "^1.11.3",
|
|
73
|
-
"@types/
|
|
74
|
-
"@types/
|
|
75
|
-
"@types/jsdom": "^
|
|
76
|
-
"@types/mime": "^
|
|
68
|
+
"@types/glob": "9.0.0",
|
|
69
|
+
"@types/highlight-words-core": "^1.2.3",
|
|
70
|
+
"@types/jsdom": "^28.0.0",
|
|
71
|
+
"@types/mime": "^4.0.0",
|
|
77
72
|
"@types/mocha": "^10.0.6",
|
|
78
|
-
"@types/node": "
|
|
79
|
-
"@types/react": "^
|
|
80
|
-
"@types/react-dom": "^
|
|
81
|
-
"@types/sinon": "^
|
|
82
|
-
"@types/sinon-chai": "^
|
|
83
|
-
"
|
|
84
|
-
"@typescript-eslint/parser": "^8.24.1",
|
|
85
|
-
"chai": "^4.3.10",
|
|
73
|
+
"@types/node": "24.12.2",
|
|
74
|
+
"@types/react": "^19.2.14",
|
|
75
|
+
"@types/react-dom": "^19.2.3",
|
|
76
|
+
"@types/sinon": "^21.0.0",
|
|
77
|
+
"@types/sinon-chai": "^4.0.0",
|
|
78
|
+
"chai": "^6.0.0",
|
|
86
79
|
"chai-dom": "^1.12.0",
|
|
87
|
-
"core-js": "3.
|
|
88
|
-
"cpy-cli": "
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"eslint-plugin-react": "^7.37.4",
|
|
93
|
-
"eslint-plugin-react-hooks": "^5.1.0",
|
|
94
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
95
|
-
"glob": "8.1.0",
|
|
96
|
-
"global-jsdom": "^9.1.0",
|
|
97
|
-
"globals": "^16.0.0",
|
|
98
|
-
"jsdom": "22.1.0",
|
|
80
|
+
"core-js": "3.49.0",
|
|
81
|
+
"cpy-cli": "7.0.0",
|
|
82
|
+
"glob": "13.0.6",
|
|
83
|
+
"global-jsdom": "^29.0.0",
|
|
84
|
+
"jsdom": "29.0.2",
|
|
99
85
|
"mocha": "^11.2.2",
|
|
100
|
-
"nyc": "
|
|
86
|
+
"nyc": "18.0.0",
|
|
101
87
|
"path-browserify": "1.0.1",
|
|
102
|
-
"
|
|
103
|
-
"react": "
|
|
104
|
-
"react-
|
|
105
|
-
"react-is": "18.2.0",
|
|
88
|
+
"react": "^19.2.5",
|
|
89
|
+
"react-dom": "^19.2.5",
|
|
90
|
+
"react-is": "^19.2.5",
|
|
106
91
|
"sass": "^1.89.2",
|
|
107
|
-
"sinon": "^
|
|
108
|
-
"sinon-chai": "^
|
|
92
|
+
"sinon": "^21.0.0",
|
|
93
|
+
"sinon-chai": "^4.0.0",
|
|
109
94
|
"ts-node": "^10.9.1",
|
|
110
|
-
"typescript": "
|
|
95
|
+
"typescript": "5.9.3"
|
|
111
96
|
},
|
|
112
97
|
"overrides": {
|
|
113
|
-
"uuid": "
|
|
98
|
+
"uuid": "13.0.0"
|
|
114
99
|
},
|
|
115
100
|
"bugs": {
|
|
116
101
|
"url": "https://github.com/cucumber/react-components/issues"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestStepResultDetails.d.ts","sourceRoot":"","sources":["../../../../src/components/results/TestStepResultDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAIjC,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,cAAc,CAapD,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ErrorMessage } from '../gherkin/index.js';
|
|
3
|
-
export const TestStepResultDetails = ({ message, exception }) => {
|
|
4
|
-
if (exception) {
|
|
5
|
-
return (React.createElement(ErrorMessage, null,
|
|
6
|
-
React.createElement("strong", null, exception.type),
|
|
7
|
-
" ",
|
|
8
|
-
exception.message,
|
|
9
|
-
exception.stackTrace && React.createElement("div", null, exception.stackTrace)));
|
|
10
|
-
}
|
|
11
|
-
if (message) {
|
|
12
|
-
return React.createElement(ErrorMessage, null, message);
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=TestStepResultDetails.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestStepResultDetails.js","sourceRoot":"","sources":["../../../../src/components/results/TestStepResultDetails.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,CAAC,MAAM,qBAAqB,GAAuB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;IAClF,IAAI,SAAS,EAAE;QACb,OAAO,CACL,oBAAC,YAAY;YACX,oCAAS,SAAS,CAAC,IAAI,CAAU;;YAAE,SAAS,CAAC,OAAO;YACnD,SAAS,CAAC,UAAU,IAAI,iCAAM,SAAS,CAAC,UAAU,CAAO,CAC7C,CAChB,CAAA;KACF;IACD,IAAI,OAAO,EAAE;QACX,OAAO,oBAAC,YAAY,QAAE,OAAO,CAAgB,CAAA;KAC9C;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA","sourcesContent":["import { TestStepResult } from '@cucumber/messages'\nimport React, { FC } from 'react'\n\nimport { ErrorMessage } from '../gherkin/index.js'\n\nexport const TestStepResultDetails: FC<TestStepResult> = ({ message, exception }) => {\n if (exception) {\n return (\n <ErrorMessage>\n <strong>{exception.type}</strong> {exception.message}\n {exception.stackTrace && <div>{exception.stackTrace}</div>}\n </ErrorMessage>\n )\n }\n if (message) {\n return <ErrorMessage>{message}</ErrorMessage>\n }\n return null\n}\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TestStepResultStatus } from '@cucumber/messages';
|
|
2
|
-
import { Query as CucumberQuery } from '@cucumber/query';
|
|
3
|
-
export default function countScenariosByStatuses(cucumberQuery: CucumberQuery): {
|
|
4
|
-
scenarioCountByStatus: Record<TestStepResultStatus, number>;
|
|
5
|
-
statusesWithScenarios: readonly TestStepResultStatus[];
|
|
6
|
-
totalScenarioCount: number;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=countScenariosByStatuses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"countScenariosByStatuses.d.ts","sourceRoot":"","sources":["../../src/countScenariosByStatuses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAIxD,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,aAAa,EAAE,aAAa,GAAG;IAC9E,qBAAqB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAA;IAC3D,qBAAqB,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACtD,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAgBA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import statuses from './statuses.js';
|
|
2
|
-
export default function countScenariosByStatuses(cucumberQuery) {
|
|
3
|
-
const scenarioCountByStatus = cucumberQuery.countMostSevereTestStepResultStatus();
|
|
4
|
-
const statusesWithScenarios = Object.entries(scenarioCountByStatus)
|
|
5
|
-
.filter(([, value]) => {
|
|
6
|
-
return value > 0;
|
|
7
|
-
})
|
|
8
|
-
.map(([key]) => key)
|
|
9
|
-
.sort(statusComparator);
|
|
10
|
-
const totalScenarioCount = [...Object.values(scenarioCountByStatus)].reduce((prev, curr) => prev + curr, 0);
|
|
11
|
-
return { scenarioCountByStatus, statusesWithScenarios, totalScenarioCount };
|
|
12
|
-
}
|
|
13
|
-
function statusComparator(a, b) {
|
|
14
|
-
if (statuses.indexOf(a) < statuses.indexOf(b)) {
|
|
15
|
-
return -1;
|
|
16
|
-
}
|
|
17
|
-
if (statuses.indexOf(a) > statuses.indexOf(b)) {
|
|
18
|
-
return 1;
|
|
19
|
-
}
|
|
20
|
-
return 0;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=countScenariosByStatuses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"countScenariosByStatuses.js","sourceRoot":"","sources":["../../src/countScenariosByStatuses.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,eAAe,CAAA;AAEpC,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,aAA4B;IAK3E,MAAM,qBAAqB,GAAG,aAAa,CAAC,mCAAmC,EAAE,CAAA;IAEjF,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC;SAChE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,OAAO,KAAK,GAAG,CAAC,CAAA;IAClB,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC;SACnB,IAAI,CAAC,gBAAgB,CAA2B,CAAA;IAEnD,MAAM,kBAAkB,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CACzE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,EAC3B,CAAC,CACF,CAAA;IAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAA;AAC7E,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAuB,EAAE,CAAuB;IACxE,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC7C,OAAO,CAAC,CAAC,CAAA;KACV;IACD,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC7C,OAAO,CAAC,CAAA;KACT;IACD,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["import { TestStepResultStatus } from '@cucumber/messages'\nimport { Query as CucumberQuery } from '@cucumber/query'\n\nimport statuses from './statuses.js'\n\nexport default function countScenariosByStatuses(cucumberQuery: CucumberQuery): {\n scenarioCountByStatus: Record<TestStepResultStatus, number>\n statusesWithScenarios: readonly TestStepResultStatus[]\n totalScenarioCount: number\n} {\n const scenarioCountByStatus = cucumberQuery.countMostSevereTestStepResultStatus()\n\n const statusesWithScenarios = Object.entries(scenarioCountByStatus)\n .filter(([, value]) => {\n return value > 0\n })\n .map(([key]) => key)\n .sort(statusComparator) as TestStepResultStatus[]\n\n const totalScenarioCount = [...Object.values(scenarioCountByStatus)].reduce(\n (prev, curr) => prev + curr,\n 0\n )\n\n return { scenarioCountByStatus, statusesWithScenarios, totalScenarioCount }\n}\n\nfunction statusComparator(a: TestStepResultStatus, b: TestStepResultStatus) {\n if (statuses.indexOf(a) < statuses.indexOf(b)) {\n return -1\n }\n if (statuses.indexOf(a) > statuses.indexOf(b)) {\n return 1\n }\n return 0\n}\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Query as GherkinQuery } from '@cucumber/gherkin-utils';
|
|
2
|
-
import * as messages from '@cucumber/messages';
|
|
3
|
-
import { Query as CucumberQuery } from '@cucumber/query';
|
|
4
|
-
export default function filterByStatus(gherkinDocument: messages.GherkinDocument, gherkinQuery: GherkinQuery, cucumberQuery: CucumberQuery, statuses: readonly messages.TestStepResultStatus[]): messages.GherkinDocument | null;
|
|
5
|
-
//# sourceMappingURL=filterByStatus.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filterByStatus.d.ts","sourceRoot":"","sources":["../../../src/filter/filterByStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE/D,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAExD,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,eAAe,EAAE,QAAQ,CAAC,eAAe,EACzC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,SAAS,QAAQ,CAAC,oBAAoB,EAAE,GACjD,QAAQ,CAAC,eAAe,GAAG,IAAI,CA0BjC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { GherkinDocumentWalker, rejectAllFilters } from '@cucumber/gherkin-utils';
|
|
2
|
-
import { getWorstTestStepResult } from '@cucumber/messages';
|
|
3
|
-
export default function filterByStatus(gherkinDocument, gherkinQuery, cucumberQuery, statuses) {
|
|
4
|
-
const filters = {
|
|
5
|
-
acceptScenario: (scenario) => {
|
|
6
|
-
if (!gherkinDocument.uri)
|
|
7
|
-
throw new Error('Missing uri for gherkinDocument');
|
|
8
|
-
const pickleIds = gherkinQuery.getPickleIds(gherkinDocument.uri, scenario.id);
|
|
9
|
-
const picklesIdsWithTestCases = cucumberQuery
|
|
10
|
-
.findAllTestCaseStarted()
|
|
11
|
-
.map((tcs) => cucumberQuery.findTestCaseBy(tcs).pickleId);
|
|
12
|
-
return pickleIds
|
|
13
|
-
.filter((pickleId) => picklesIdsWithTestCases.includes(pickleId))
|
|
14
|
-
.some((pickleId) => statuses.includes(getWorstTestStepResult(cucumberQuery.getPickleTestStepResults([pickleId])).status));
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
const walker = new GherkinDocumentWalker({
|
|
18
|
-
...rejectAllFilters,
|
|
19
|
-
...filters,
|
|
20
|
-
});
|
|
21
|
-
return walker.walkGherkinDocument(gherkinDocument);
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=filterByStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filterByStatus.js","sourceRoot":"","sources":["../../../src/filter/filterByStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEjF,OAAO,EAAE,sBAAsB,EAAY,MAAM,oBAAoB,CAAA;AAGrE,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,eAAyC,EACzC,YAA0B,EAC1B,aAA4B,EAC5B,QAAkD;IAElD,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,CAAC,QAA2B,EAAE,EAAE;YAC9C,IAAI,CAAC,eAAe,CAAC,GAAG;gBAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;YAC5E,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;YAE7E,MAAM,uBAAuB,GAAG,aAAa;iBAC1C,sBAAsB,EAAE;iBACxB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,aAAa,CAAC,cAAc,CAAC,GAAG,CAAc,CAAC,QAAQ,CAAC,CAAA;YAEzE,OAAO,SAAS;iBACb,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,uBAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;iBAChE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjB,QAAQ,CAAC,QAAQ,CACf,sBAAsB,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAClF,CACF,CAAA;QACL,CAAC;KACF,CAAA;IAED,MAAM,MAAM,GAAG,IAAI,qBAAqB,CAAC;QACvC,GAAG,gBAAgB;QACnB,GAAG,OAAO;KACX,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAA;AACpD,CAAC","sourcesContent":["import { Query as GherkinQuery } from '@cucumber/gherkin-utils'\nimport { GherkinDocumentWalker, rejectAllFilters } from '@cucumber/gherkin-utils'\nimport * as messages from '@cucumber/messages'\nimport { getWorstTestStepResult, TestCase } from '@cucumber/messages'\nimport { Query as CucumberQuery } from '@cucumber/query'\n\nexport default function filterByStatus(\n gherkinDocument: messages.GherkinDocument,\n gherkinQuery: GherkinQuery,\n cucumberQuery: CucumberQuery,\n statuses: readonly messages.TestStepResultStatus[]\n): messages.GherkinDocument | null {\n const filters = {\n acceptScenario: (scenario: messages.Scenario) => {\n if (!gherkinDocument.uri) throw new Error('Missing uri for gherkinDocument')\n const pickleIds = gherkinQuery.getPickleIds(gherkinDocument.uri, scenario.id)\n\n const picklesIdsWithTestCases = cucumberQuery\n .findAllTestCaseStarted()\n .map((tcs) => (cucumberQuery.findTestCaseBy(tcs) as TestCase).pickleId)\n\n return pickleIds\n .filter((pickleId) => picklesIdsWithTestCases.includes(pickleId))\n .some((pickleId) =>\n statuses.includes(\n getWorstTestStepResult(cucumberQuery.getPickleTestStepResults([pickleId])).status\n )\n )\n },\n }\n\n const walker = new GherkinDocumentWalker({\n ...rejectAllFilters,\n ...filters,\n })\n\n return walker.walkGherkinDocument(gherkinDocument)\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Query as GherkinQuery } from '@cucumber/gherkin-utils';
|
|
2
|
-
import { Searchable } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a search index that supports querying by term or tag expression, and
|
|
5
|
-
* returns an array of abridged Gherkin documents matching the query.
|
|
6
|
-
*
|
|
7
|
-
* @param gherkinQuery - query instance used internally for searching, with any
|
|
8
|
-
* documents already present being pre-populated in the search index
|
|
9
|
-
*/
|
|
10
|
-
export declare function createSearch(gherkinQuery: GherkinQuery): Promise<Searchable>;
|
|
11
|
-
//# sourceMappingURL=Search.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/search/Search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAM/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA2BvC;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAUlF"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import isTagExpression from '../isTagExpression.js';
|
|
2
|
-
import { createTagSearch } from './TagSearch.js';
|
|
3
|
-
import { createTextSearch } from './TextSearch.js';
|
|
4
|
-
class Search {
|
|
5
|
-
tagSearch;
|
|
6
|
-
textSearch;
|
|
7
|
-
constructor(tagSearch, textSearch) {
|
|
8
|
-
this.tagSearch = tagSearch;
|
|
9
|
-
this.textSearch = textSearch;
|
|
10
|
-
}
|
|
11
|
-
async search(query) {
|
|
12
|
-
if (isTagExpression(query)) {
|
|
13
|
-
try {
|
|
14
|
-
return await this.tagSearch.search(query);
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
// No-op, we fall back to text search.
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return this.textSearch.search(query);
|
|
21
|
-
}
|
|
22
|
-
async add(gherkinDocument) {
|
|
23
|
-
await this.tagSearch.add(gherkinDocument);
|
|
24
|
-
await this.textSearch.add(gherkinDocument);
|
|
25
|
-
return this;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Creates a search index that supports querying by term or tag expression, and
|
|
30
|
-
* returns an array of abridged Gherkin documents matching the query.
|
|
31
|
-
*
|
|
32
|
-
* @param gherkinQuery - query instance used internally for searching, with any
|
|
33
|
-
* documents already present being pre-populated in the search index
|
|
34
|
-
*/
|
|
35
|
-
export async function createSearch(gherkinQuery) {
|
|
36
|
-
const [tagSearch, textSearch] = await Promise.all([
|
|
37
|
-
createTagSearch(gherkinQuery),
|
|
38
|
-
createTextSearch(),
|
|
39
|
-
]);
|
|
40
|
-
const searchImpl = new Search(tagSearch, textSearch);
|
|
41
|
-
for (const doc of gherkinQuery.getGherkinDocuments()) {
|
|
42
|
-
await searchImpl.add(doc);
|
|
43
|
-
}
|
|
44
|
-
return searchImpl;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=Search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/search/Search.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGlD,MAAM,MAAM;IAES;IACA;IAFnB,YACmB,SAAqB,EACrB,UAAsB;QADtB,cAAS,GAAT,SAAS,CAAY;QACrB,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAEG,KAAK,CAAC,MAAM,CAAC,KAAa;QAC/B,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE;YAC1B,IAAI;gBACF,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;aAC1C;YAAC,MAAM;gBACN,sCAAsC;aACvC;SACF;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACtC,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,eAAyC;QACxD,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QACzC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,YAA0B;IAC3D,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAChD,eAAe,CAAC,YAAY,CAAC;QAC7B,gBAAgB,EAAE;KACnB,CAAC,CAAA;IACF,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IACpD,KAAK,MAAM,GAAG,IAAI,YAAY,CAAC,mBAAmB,EAAE,EAAE;QACpD,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;KAC1B;IACD,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { Query as GherkinQuery } from '@cucumber/gherkin-utils'\nimport * as messages from '@cucumber/messages'\n\nimport isTagExpression from '../isTagExpression.js'\nimport { createTagSearch } from './TagSearch.js'\nimport { createTextSearch } from './TextSearch.js'\nimport { Searchable } from './types.js'\n\nclass Search {\n constructor(\n private readonly tagSearch: Searchable,\n private readonly textSearch: Searchable\n ) {}\n\n public async search(query: string): Promise<readonly messages.GherkinDocument[]> {\n if (isTagExpression(query)) {\n try {\n return await this.tagSearch.search(query)\n } catch {\n // No-op, we fall back to text search.\n }\n }\n\n return this.textSearch.search(query)\n }\n\n public async add(gherkinDocument: messages.GherkinDocument) {\n await this.tagSearch.add(gherkinDocument)\n await this.textSearch.add(gherkinDocument)\n return this\n }\n}\n\n/**\n * Creates a search index that supports querying by term or tag expression, and\n * returns an array of abridged Gherkin documents matching the query.\n *\n * @param gherkinQuery - query instance used internally for searching, with any\n * documents already present being pre-populated in the search index\n */\nexport async function createSearch(gherkinQuery: GherkinQuery): Promise<Searchable> {\n const [tagSearch, textSearch] = await Promise.all([\n createTagSearch(gherkinQuery),\n createTextSearch(),\n ])\n const searchImpl = new Search(tagSearch, textSearch)\n for (const doc of gherkinQuery.getGherkinDocuments()) {\n await searchImpl.add(doc)\n }\n return searchImpl\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TagSearch.d.ts","sourceRoot":"","sources":["../../../src/search/TagSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,YAAY,EAEtB,MAAM,yBAAyB,CAAA;AAMhC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA6DvC,wBAAsB,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAErF"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { GherkinDocumentWalker, rejectAllFilters, } from '@cucumber/gherkin-utils';
|
|
2
|
-
import parse from '@cucumber/tag-expressions';
|
|
3
|
-
import { ArrayMultimap } from '@teppeis/multimaps';
|
|
4
|
-
class TagSearch {
|
|
5
|
-
gherkinQuery;
|
|
6
|
-
pickleById = new Map();
|
|
7
|
-
picklesByScenarioId = new ArrayMultimap();
|
|
8
|
-
gherkinDocuments = [];
|
|
9
|
-
constructor(gherkinQuery) {
|
|
10
|
-
this.gherkinQuery = gherkinQuery;
|
|
11
|
-
this.gherkinQuery = gherkinQuery;
|
|
12
|
-
}
|
|
13
|
-
async search(query) {
|
|
14
|
-
const expressionNode = parse(query);
|
|
15
|
-
const tagFilters = {
|
|
16
|
-
acceptScenario: (scenario) => {
|
|
17
|
-
const pickles = this.picklesByScenarioId.get(scenario.id);
|
|
18
|
-
for (const pickle of pickles) {
|
|
19
|
-
const tags = pickle.tags.map((tag) => tag.name);
|
|
20
|
-
if (expressionNode.evaluate(tags)) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
const filters = { ...rejectAllFilters, ...tagFilters };
|
|
28
|
-
const astWalker = new GherkinDocumentWalker(filters);
|
|
29
|
-
return this.gherkinDocuments
|
|
30
|
-
.map((gherkinDocument) => astWalker.walkGherkinDocument(gherkinDocument))
|
|
31
|
-
.filter((gherkinDocument) => gherkinDocument !== null);
|
|
32
|
-
}
|
|
33
|
-
async add(gherkinDocument) {
|
|
34
|
-
this.gherkinDocuments.push(gherkinDocument);
|
|
35
|
-
const pickles = this.gherkinQuery.getPickles();
|
|
36
|
-
pickles.forEach((pickle) => this.pickleById.set(pickle.id, pickle));
|
|
37
|
-
const astWalker = new GherkinDocumentWalker({}, {
|
|
38
|
-
handleScenario: (scenario) => {
|
|
39
|
-
if (!gherkinDocument.uri)
|
|
40
|
-
throw new Error('No uri for gherkinDocument');
|
|
41
|
-
const pickleIds = this.gherkinQuery.getPickleIds(gherkinDocument.uri, scenario.id);
|
|
42
|
-
pickleIds.map((pickleId) => {
|
|
43
|
-
const pickle = this.pickleById.get(pickleId);
|
|
44
|
-
if (!pickle)
|
|
45
|
-
throw new Error(`No pickle for id=${pickleId}`);
|
|
46
|
-
this.picklesByScenarioId.put(scenario.id, pickle);
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
astWalker.walkGherkinDocument(gherkinDocument);
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export async function createTagSearch(gherkinQuery) {
|
|
55
|
-
return new TagSearch(gherkinQuery);
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=TagSearch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TagSearch.js","sourceRoot":"","sources":["../../../src/search/TagSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,gBAAgB,GACjB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,KAAK,MAAM,2BAA2B,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIlD,MAAM,SAAS;IAKgB;IAJZ,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAA;IAC/C,mBAAmB,GAAG,IAAI,aAAa,EAA2B,CAAA;IAC3E,gBAAgB,GAA+B,EAAE,CAAA;IAEzD,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;QACrD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,KAAa;QAC/B,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,UAAU,GAAG;YACjB,cAAc,EAAE,CAAC,QAA2B,EAAE,EAAE;gBAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;gBAEzD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;oBAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;oBAC/C,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;wBACjC,OAAO,IAAI,CAAA;qBACZ;iBACF;gBAED,OAAO,KAAK,CAAA;YACd,CAAC;SACF,CAAA;QACD,MAAM,OAAO,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,UAAU,EAAE,CAAA;QACtD,MAAM,SAAS,GAAG,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAA;QAEpD,OAAO,IAAI,CAAC,gBAAgB;aACzB,GAAG,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,SAAS,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;aACxE,MAAM,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe,KAAK,IAAI,CAAsB,CAAA;IAC/E,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,eAAyC;QACxD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAA;QAC9C,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAA;QAEnE,MAAM,SAAS,GAAG,IAAI,qBAAqB,CACzC,EAAE,EACF;YACE,cAAc,EAAE,CAAC,QAAQ,EAAE,EAAE;gBAC3B,IAAI,CAAC,eAAe,CAAC,GAAG;oBAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;gBACvE,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;gBAElF,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;oBACzB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;oBAC5C,IAAI,CAAC,MAAM;wBAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,QAAQ,EAAE,CAAC,CAAA;oBAC5D,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;gBACnD,CAAC,CAAC,CAAA;YACJ,CAAC;SACF,CACF,CAAA;QACD,SAAS,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAA;QAE9C,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,YAA0B;IAC9D,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC,CAAA;AACpC,CAAC","sourcesContent":["import {\n GherkinDocumentWalker,\n Query as GherkinQuery,\n rejectAllFilters,\n} from '@cucumber/gherkin-utils'\nimport * as messages from '@cucumber/messages'\nimport { GherkinDocument } from '@cucumber/messages'\nimport parse from '@cucumber/tag-expressions'\nimport { ArrayMultimap } from '@teppeis/multimaps'\n\nimport { Searchable } from './types.js'\n\nclass TagSearch {\n private readonly pickleById = new Map<string, messages.Pickle>()\n private readonly picklesByScenarioId = new ArrayMultimap<string, messages.Pickle>()\n private gherkinDocuments: messages.GherkinDocument[] = []\n\n constructor(private readonly gherkinQuery: GherkinQuery) {\n this.gherkinQuery = gherkinQuery\n }\n\n public async search(query: string): Promise<readonly messages.GherkinDocument[]> {\n const expressionNode = parse(query)\n const tagFilters = {\n acceptScenario: (scenario: messages.Scenario) => {\n const pickles = this.picklesByScenarioId.get(scenario.id)\n\n for (const pickle of pickles) {\n const tags = pickle.tags.map((tag) => tag.name)\n if (expressionNode.evaluate(tags)) {\n return true\n }\n }\n\n return false\n },\n }\n const filters = { ...rejectAllFilters, ...tagFilters }\n const astWalker = new GherkinDocumentWalker(filters)\n\n return this.gherkinDocuments\n .map((gherkinDocument) => astWalker.walkGherkinDocument(gherkinDocument))\n .filter((gherkinDocument) => gherkinDocument !== null) as GherkinDocument[]\n }\n\n public async add(gherkinDocument: messages.GherkinDocument) {\n this.gherkinDocuments.push(gherkinDocument)\n const pickles = this.gherkinQuery.getPickles()\n pickles.forEach((pickle) => this.pickleById.set(pickle.id, pickle))\n\n const astWalker = new GherkinDocumentWalker(\n {},\n {\n handleScenario: (scenario) => {\n if (!gherkinDocument.uri) throw new Error('No uri for gherkinDocument')\n const pickleIds = this.gherkinQuery.getPickleIds(gherkinDocument.uri, scenario.id)\n\n pickleIds.map((pickleId) => {\n const pickle = this.pickleById.get(pickleId)\n if (!pickle) throw new Error(`No pickle for id=${pickleId}`)\n this.picklesByScenarioId.put(scenario.id, pickle)\n })\n },\n }\n )\n astWalker.walkGherkinDocument(gherkinDocument)\n\n return this\n }\n}\n\nexport async function createTagSearch(gherkinQuery: GherkinQuery): Promise<Searchable> {\n return new TagSearch(gherkinQuery)\n}\n"]}
|