@cucumber/cucumber 11.1.1 → 11.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.
Files changed (231) hide show
  1. package/README.md +9 -7
  2. package/lib/api/convert_configuration.d.ts +1 -2
  3. package/lib/api/convert_configuration.js +1 -2
  4. package/lib/api/convert_configuration.js.map +1 -1
  5. package/lib/api/formatters.d.ts +1 -3
  6. package/lib/api/formatters.js +2 -3
  7. package/lib/api/formatters.js.map +1 -1
  8. package/lib/api/gherkin.js +1 -2
  9. package/lib/api/gherkin.js.map +1 -1
  10. package/lib/api/index.d.ts +1 -0
  11. package/lib/api/index.js.map +1 -1
  12. package/lib/api/load_configuration.d.ts +2 -1
  13. package/lib/api/load_configuration.js +3 -4
  14. package/lib/api/load_configuration.js.map +1 -1
  15. package/lib/api/load_sources.d.ts +2 -1
  16. package/lib/api/load_sources.js +4 -5
  17. package/lib/api/load_sources.js.map +1 -1
  18. package/lib/api/load_support.d.ts +2 -1
  19. package/lib/api/load_support.js +4 -5
  20. package/lib/api/load_support.js.map +1 -1
  21. package/lib/api/plugins.d.ts +5 -5
  22. package/lib/api/plugins.js +12 -13
  23. package/lib/api/plugins.js.map +1 -1
  24. package/lib/api/run_cucumber.d.ts +2 -1
  25. package/lib/api/run_cucumber.js +4 -5
  26. package/lib/api/run_cucumber.js.map +1 -1
  27. package/lib/api/support.d.ts +1 -1
  28. package/lib/api/support.js +1 -2
  29. package/lib/api/support.js.map +1 -1
  30. package/lib/api/test_helpers.d.ts +1 -1
  31. package/lib/api/test_helpers.js +2 -3
  32. package/lib/api/test_helpers.js.map +1 -1
  33. package/lib/api/types.d.ts +0 -35
  34. package/lib/api/types.js.map +1 -1
  35. package/lib/assemble/assemble_test_cases.d.ts +1 -7
  36. package/lib/assemble/assemble_test_cases.js +3 -3
  37. package/lib/assemble/assemble_test_cases.js.map +1 -1
  38. package/lib/cli/helpers.d.ts +1 -3
  39. package/lib/cli/helpers.js +61 -33
  40. package/lib/cli/helpers.js.map +1 -1
  41. package/lib/cli/i18n.js +2 -3
  42. package/lib/cli/i18n.js.map +1 -1
  43. package/lib/cli/index.d.ts +0 -1
  44. package/lib/cli/index.js.map +1 -1
  45. package/lib/cli/install_validator.js +1 -2
  46. package/lib/cli/install_validator.js.map +1 -1
  47. package/lib/cli/run.js +1 -1
  48. package/lib/cli/run.js.map +1 -1
  49. package/lib/cli/validate_node_engine_version.js +1 -2
  50. package/lib/cli/validate_node_engine_version.js.map +1 -1
  51. package/lib/configuration/argv_parser.js.map +1 -1
  52. package/lib/configuration/check_schema.js +18 -9
  53. package/lib/configuration/check_schema.js.map +1 -1
  54. package/lib/configuration/from_file.d.ts +1 -1
  55. package/lib/configuration/from_file.js +3 -4
  56. package/lib/configuration/from_file.js.map +1 -1
  57. package/lib/configuration/helpers.js +1 -2
  58. package/lib/configuration/helpers.js.map +1 -1
  59. package/lib/configuration/locate_file.js +1 -2
  60. package/lib/configuration/locate_file.js.map +1 -1
  61. package/lib/configuration/merge_configurations.js +1 -2
  62. package/lib/configuration/merge_configurations.js.map +1 -1
  63. package/lib/configuration/parse_configuration.d.ts +1 -1
  64. package/lib/configuration/parse_configuration.js +1 -2
  65. package/lib/configuration/parse_configuration.js.map +1 -1
  66. package/lib/configuration/split_format_descriptor.d.ts +1 -1
  67. package/lib/configuration/split_format_descriptor.js +1 -2
  68. package/lib/configuration/split_format_descriptor.js.map +1 -1
  69. package/lib/configuration/validate_configuration.d.ts +1 -1
  70. package/lib/configuration/validate_configuration.js +1 -2
  71. package/lib/configuration/validate_configuration.js.map +1 -1
  72. package/lib/environment/console_logger.d.ts +11 -0
  73. package/lib/{api → environment}/console_logger.js +6 -6
  74. package/lib/environment/console_logger.js.map +1 -0
  75. package/lib/environment/index.d.ts +2 -0
  76. package/lib/environment/index.js +19 -0
  77. package/lib/environment/index.js.map +1 -0
  78. package/lib/environment/make_environment.d.ts +2 -0
  79. package/lib/{api/environment.js → environment/make_environment.js} +3 -4
  80. package/lib/environment/make_environment.js.map +1 -0
  81. package/lib/environment/types.d.ts +41 -0
  82. package/lib/{logger.js → environment/types.js} +1 -1
  83. package/lib/environment/types.js.map +1 -0
  84. package/lib/filter_stack_trace.js +2 -3
  85. package/lib/filter_stack_trace.js.map +1 -1
  86. package/lib/formatter/builder.d.ts +1 -5
  87. package/lib/formatter/builder.js.map +1 -1
  88. package/lib/formatter/builtin/html.js +1 -4
  89. package/lib/formatter/builtin/html.js.map +1 -1
  90. package/lib/formatter/builtin/index.d.ts +1 -1
  91. package/lib/formatter/create_stream.d.ts +1 -2
  92. package/lib/formatter/create_stream.js +1 -2
  93. package/lib/formatter/create_stream.js.map +1 -1
  94. package/lib/formatter/find_class_or_plugin.js +1 -2
  95. package/lib/formatter/find_class_or_plugin.js.map +1 -1
  96. package/lib/formatter/get_color_fns.d.ts +0 -2
  97. package/lib/formatter/get_color_fns.js +1 -1
  98. package/lib/formatter/get_color_fns.js.map +1 -1
  99. package/lib/formatter/helpers/duration_helpers.js +2 -3
  100. package/lib/formatter/helpers/duration_helpers.js.map +1 -1
  101. package/lib/formatter/helpers/event_data_collector.d.ts +0 -1
  102. package/lib/formatter/helpers/event_data_collector.js +17 -7
  103. package/lib/formatter/helpers/event_data_collector.js.map +1 -1
  104. package/lib/formatter/helpers/gherkin_document_parser.js +4 -5
  105. package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -1
  106. package/lib/formatter/helpers/index.js +17 -7
  107. package/lib/formatter/helpers/index.js.map +1 -1
  108. package/lib/formatter/helpers/issue_helpers.js +6 -7
  109. package/lib/formatter/helpers/issue_helpers.js.map +1 -1
  110. package/lib/formatter/helpers/keyword_type.js +3 -3
  111. package/lib/formatter/helpers/keyword_type.js.map +1 -1
  112. package/lib/formatter/helpers/location_helpers.js +1 -2
  113. package/lib/formatter/helpers/location_helpers.js.map +1 -1
  114. package/lib/formatter/helpers/pickle_parser.js +4 -5
  115. package/lib/formatter/helpers/pickle_parser.js.map +1 -1
  116. package/lib/formatter/helpers/step_argument_formatter.js +1 -2
  117. package/lib/formatter/helpers/step_argument_formatter.js.map +1 -1
  118. package/lib/formatter/helpers/summary_helpers.js +18 -9
  119. package/lib/formatter/helpers/summary_helpers.js.map +1 -1
  120. package/lib/formatter/helpers/test_case_attempt_formatter.js +18 -9
  121. package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -1
  122. package/lib/formatter/helpers/test_case_attempt_parser.js +18 -9
  123. package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
  124. package/lib/formatter/helpers/usage_helpers/index.js +18 -9
  125. package/lib/formatter/helpers/usage_helpers/index.js.map +1 -1
  126. package/lib/formatter/import_code.js +1 -2
  127. package/lib/formatter/import_code.js.map +1 -1
  128. package/lib/formatter/index.d.ts +0 -2
  129. package/lib/formatter/json_formatter.js +17 -7
  130. package/lib/formatter/json_formatter.js.map +1 -1
  131. package/lib/formatter/progress_bar_formatter.js.map +1 -1
  132. package/lib/formatter/progress_formatter.js +17 -7
  133. package/lib/formatter/progress_formatter.js.map +1 -1
  134. package/lib/formatter/rerun_formatter.js +17 -7
  135. package/lib/formatter/rerun_formatter.js.map +1 -1
  136. package/lib/formatter/resolve_implementation.js +1 -2
  137. package/lib/formatter/resolve_implementation.js.map +1 -1
  138. package/lib/formatter/snippets_formatter.js +17 -7
  139. package/lib/formatter/snippets_formatter.js.map +1 -1
  140. package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -1
  141. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -1
  142. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js +1 -1
  143. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -1
  144. package/lib/formatter/summary_formatter.js.map +1 -1
  145. package/lib/formatter/usage_formatter.js +17 -7
  146. package/lib/formatter/usage_formatter.js.map +1 -1
  147. package/lib/formatter/usage_json_formatter.js.map +1 -1
  148. package/lib/index.d.ts +4 -4
  149. package/lib/index.js +17 -7
  150. package/lib/index.js.map +1 -1
  151. package/lib/models/data_table.js.map +1 -1
  152. package/lib/models/step_definition.js.map +1 -1
  153. package/lib/paths/paths.d.ts +1 -1
  154. package/lib/paths/paths.js +1 -2
  155. package/lib/paths/paths.js.map +1 -1
  156. package/lib/pickle_filter.js.map +1 -1
  157. package/lib/plugin/plugin_manager.d.ts +5 -4
  158. package/lib/plugin/plugin_manager.js +14 -6
  159. package/lib/plugin/plugin_manager.js.map +1 -1
  160. package/lib/plugin/types.d.ts +4 -3
  161. package/lib/plugin/types.js.map +1 -1
  162. package/lib/publish/publish_plugin.js +46 -16
  163. package/lib/publish/publish_plugin.js.map +1 -1
  164. package/lib/runtime/attachment_manager/index.d.ts +0 -2
  165. package/lib/runtime/attachment_manager/index.js +17 -7
  166. package/lib/runtime/attachment_manager/index.js.map +1 -1
  167. package/lib/runtime/coordinator.d.ts +0 -1
  168. package/lib/runtime/coordinator.js +4 -6
  169. package/lib/runtime/coordinator.js.map +1 -1
  170. package/lib/runtime/format_error.js +1 -2
  171. package/lib/runtime/format_error.js.map +1 -1
  172. package/lib/runtime/helpers.js +20 -11
  173. package/lib/runtime/helpers.js.map +1 -1
  174. package/lib/runtime/make_runtime.d.ts +3 -3
  175. package/lib/runtime/make_runtime.js +1 -2
  176. package/lib/runtime/make_runtime.js.map +1 -1
  177. package/lib/runtime/parallel/adapter.d.ts +2 -4
  178. package/lib/runtime/parallel/adapter.js.map +1 -1
  179. package/lib/runtime/parallel/run_worker.js.map +1 -1
  180. package/lib/runtime/parallel/worker.js.map +1 -1
  181. package/lib/runtime/run_test_run_hooks.js.map +1 -1
  182. package/lib/runtime/scope/make_proxy.js +1 -2
  183. package/lib/runtime/scope/make_proxy.js.map +1 -1
  184. package/lib/runtime/scope/test_case_scope.js +2 -2
  185. package/lib/runtime/scope/test_case_scope.js.map +1 -1
  186. package/lib/runtime/scope/test_run_scope.js +2 -2
  187. package/lib/runtime/scope/test_run_scope.js.map +1 -1
  188. package/lib/runtime/serial/adapter.d.ts +0 -1
  189. package/lib/runtime/serial/adapter.js.map +1 -1
  190. package/lib/runtime/step_runner.js +24 -13
  191. package/lib/runtime/step_runner.js.map +1 -1
  192. package/lib/runtime/stopwatch.js.map +1 -1
  193. package/lib/runtime/test_case_runner.d.ts +0 -1
  194. package/lib/runtime/test_case_runner.js +17 -7
  195. package/lib/runtime/test_case_runner.js.map +1 -1
  196. package/lib/runtime/worker.d.ts +0 -1
  197. package/lib/runtime/worker.js.map +1 -1
  198. package/lib/step_arguments.js +1 -2
  199. package/lib/step_arguments.js.map +1 -1
  200. package/lib/support_code_library_builder/build_parameter_type.js +1 -2
  201. package/lib/support_code_library_builder/build_parameter_type.js.map +1 -1
  202. package/lib/support_code_library_builder/get_definition_line_and_uri.js +1 -2
  203. package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +1 -1
  204. package/lib/support_code_library_builder/index.js.map +1 -1
  205. package/lib/support_code_library_builder/parallel_can_assign_helpers.js +1 -2
  206. package/lib/support_code_library_builder/parallel_can_assign_helpers.js.map +1 -1
  207. package/lib/support_code_library_builder/validate_arguments.js +1 -1
  208. package/lib/support_code_library_builder/validate_arguments.js.map +1 -1
  209. package/lib/time.d.ts +0 -2
  210. package/lib/time.js +19 -10
  211. package/lib/time.js.map +1 -1
  212. package/lib/try_require.js +1 -1
  213. package/lib/try_require.js.map +1 -1
  214. package/lib/tsconfig.node.tsbuildinfo +1 -0
  215. package/lib/uncaught_exception_manager.d.ts +0 -1
  216. package/lib/user_code_runner.js.map +1 -1
  217. package/lib/value_checker.js +3 -4
  218. package/lib/value_checker.js.map +1 -1
  219. package/lib/version.d.ts +1 -1
  220. package/lib/version.js +1 -1
  221. package/lib/version.js.map +1 -1
  222. package/package.json +53 -55
  223. package/lib/api/console_logger.d.ts +0 -12
  224. package/lib/api/console_logger.js.map +0 -1
  225. package/lib/api/environment.d.ts +0 -7
  226. package/lib/api/environment.js.map +0 -1
  227. package/lib/logger.d.ts +0 -5
  228. package/lib/logger.js.map +0 -1
  229. package/lib/publish/http_stream.d.ts +0 -30
  230. package/lib/publish/http_stream.js +0 -117
  231. package/lib/publish/http_stream.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/support_code_library_builder/index.ts"],"names":[],"mappings":";;;;;;AAEA,4DAA8B;AAC9B,yEAGuC;AACvC,oGAAwE;AACxE,oGAAwE;AACxE,kGAAsE;AACtE,gFAAsD;AACtD,kDAAqD;AACrD,oDAAgD;AAEhD,8EAAoD;AAkBpD,oDAA2B;AAC3B,+EAAuE;AACvE,iEAA2D;AAC3D,uFAAgF;AAkChF,MAAa,yBAAyB;IACpB,OAAO,CAA2B;IAC1C,mBAAmB,CAAyB;IAC5C,kCAAkC,CAAiC;IACnE,iCAAiC,CAAgC;IACjE,kCAAkC,CAAiC;IACnE,mCAAmC,CAAiC;IACpE,kCAAkC,CAAgC;IAClE,mCAAmC,CAAiC;IACpE,GAAG,CAAQ;IACX,cAAc,CAAQ;IACtB,yBAAyB,CAAK;IAC9B,KAAK,CAAmB;IACxB,qBAAqB,CAA8B;IACnD,qBAAqB,CAAyB;IAC9C,KAAK,CAAK;IACV,iBAAiB,CAA6B;IAC9C,MAAM,GAAkB,SAAS,CAAA;IAEzC;QACE,MAAM,OAAO,GAA8B;YACzC,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAC5B,GAAG,EAAE,CAAC,IAAI,CAAC,kCAAkC,CAC9C;YACD,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAC9B,GAAG,EAAE,CAAC,IAAI,CAAC,iCAAiC,CAC7C;YACD,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAChC,GAAG,EAAE,CAAC,IAAI,CAAC,kCAAkC,CAC9C;YACD,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAC7B,GAAG,EAAE,CAAC,IAAI,CAAC,mCAAmC,CAC/C;YACD,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAC/B,GAAG,EAAE,CAAC,IAAI,CAAC,kCAA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CAAC,iBAAiB;SAC1C,CAAA;IACH,CAAC;IAED,KAAK,CACH,GAAW,EACX,KAAwB,EACxB,sBAA+C;QAC7C,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;KACZ;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;QAC9C,IAAI,CAAC,kCAAkC,GAAG,EAAE,CAAA;QAC5C,IAAI,CAAC,iCAAiC,GAAG,EAAE,CAAA;QAC3C,IAAI,CAAC,kCAAkC,GAAG,EAAE,CAAA;QAC5C,IAAI,CAAC,mCAAmC,GAAG,EAAE,CAAA;QAC7C,IAAI,CAAC,kCAAkC,GAAG,EAAE,CAAA;QAC5C,IAAI,CAAC,mCAAmC,GAAG,EAAE,CAAA;QAC7C,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAA;QACrC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAA;QAC1B,IAAI,CAAC,qBAAqB,GAAG,IAAI,8DAA4B,EAAE,CAAA;QAC/D,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAA;QAC/B,IAAI,CAAC,iBAAiB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;QACnC,IAAI,CAAC,KAAK,GAAG,eAAK,CAAA;QAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AA3ZD,8DA2ZC;AAED,kBAAe,IAAI,yBAAyB,EAAE,CAAA","sourcesContent":["import { IdGenerator } from '@cucumber/messages'\nimport * as messages from '@cucumber/messages'\nimport arity from 'util-arity'\nimport {\n CucumberExpression,\n RegularExpression,\n} from '@cucumber/cucumber-expressions'\nimport TestCaseHookDefinition from '../models/test_case_hook_definition'\nimport TestStepHookDefinition from '../models/test_step_hook_definition'\nimport TestRunHookDefinition from '../models/test_run_hook_definition'\nimport StepDefinition from '../models/step_definition'\nimport { formatLocation } from '../formatter/helpers'\nimport { doesHaveValue } from '../value_checker'\nimport { GherkinStepKeyword } from '../models/gherkin_step_keyword'\nimport validateArguments from './validate_arguments'\n\nimport {\n DefineStepPattern,\n IDefineStepOptions,\n IDefineSupportCodeMethods,\n IDefineTestCaseHookOptions,\n IDefineTestStepHookOptions,\n IDefineTestRunHookOptions,\n IParameterTypeDefinition,\n SupportCodeLibrary,\n TestCaseHookFunction,\n TestStepHookFunction,\n ParallelAssignmentValidator,\n ISupportCodeCoordinates,\n IDefineStep,\n CanonicalSupportCodeIds,\n} from './types'\nimport World from './world'\nimport { getDefinitionLineAndUri } from './get_definition_line_and_uri'\nimport { buildParameterType } from './build_parameter_type'\nimport { SourcedParameterTypeRegistry } from './sourced_parameter_type_registry'\n\ninterface IStepDefinitionConfig {\n code: Function\n line: number\n options: any\n keyword: GherkinStepKeyword\n pattern: string | RegExp\n uri: string\n}\n\ninterface ITestCaseHookDefinitionConfig {\n code: any\n line: number\n options: any\n uri: string\n}\n\ninterface ITestStepHookDefinitionConfig {\n code: Function\n line: number\n options: any\n uri: string\n}\n\ninterface ITestRunHookDefinitionConfig {\n code: Function\n line: number\n options: any\n uri: string\n}\n\ntype LibraryStatus = 'PENDING' | 'OPEN' | 'FINALIZED'\n\nexport class SupportCodeLibraryBuilder {\n public readonly methods: IDefineSupportCodeMethods\n private originalCoordinates: ISupportCodeCoordinates\n private afterTestCaseHookDefinitionConfigs: ITestCaseHookDefinitionConfig[]\n private afterTestRunHookDefinitionConfigs: ITestRunHookDefinitionConfig[]\n private afterTestStepHookDefinitionConfigs: ITestStepHookDefinitionConfig[]\n private beforeTestCaseHookDefinitionConfigs: ITestCaseHookDefinitionConfig[]\n private beforeTestRunHookDefinitionConfigs: ITestRunHookDefinitionConfig[]\n private beforeTestStepHookDefinitionConfigs: ITestStepHookDefinitionConfig[]\n private cwd: string\n private defaultTimeout: number\n private definitionFunctionWrapper: any\n private newId: IdGenerator.NewId\n private parameterTypeRegistry: SourcedParameterTypeRegistry\n private stepDefinitionConfigs: IStepDefinitionConfig[]\n private World: any\n private parallelCanAssign: ParallelAssignmentValidator\n private status: LibraryStatus = 'PENDING'\n\n constructor() {\n const methods: IDefineSupportCodeMethods = {\n After: this.defineTestCaseHook(\n () => this.afterTestCaseHookDefinitionConfigs\n ),\n AfterAll: this.defineTestRunHook(\n () => this.afterTestRunHookDefinitionConfigs\n ),\n AfterStep: this.defineTestStepHook(\n () => this.afterTestStepHookDefinitionConfigs\n ),\n Before: this.defineTestCaseHook(\n () => this.beforeTestCaseHookDefinitionConfigs\n ),\n BeforeAll: this.defineTestRunHook(\n () => this.beforeTestRunHookDefinitionConfigs\n ),\n BeforeStep: this.defineTestStepHook(\n () => this.beforeTestStepHookDefinitionConfigs\n ),\n defineParameterType: this.defineParameterType.bind(this),\n defineStep: this.defineStep('Unknown', () => this.stepDefinitionConfigs),\n Given: this.defineStep('Given', () => this.stepDefinitionConfigs),\n setDefaultTimeout: (milliseconds) => {\n this.defaultTimeout = milliseconds\n },\n setDefinitionFunctionWrapper: (fn) => {\n this.definitionFunctionWrapper = fn\n },\n setWorldConstructor: (fn) => {\n this.World = fn\n },\n setParallelCanAssign: (fn: ParallelAssignmentValidator): void => {\n this.parallelCanAssign = fn\n },\n Then: this.defineStep('Then', () => this.stepDefinitionConfigs),\n When: this.defineStep('When', () => this.stepDefinitionConfigs),\n }\n const checkInstall = (method: string) => {\n if (this.status === 'PENDING') {\n throw new Error(\n `\n You're calling functions (e.g. \"${method}\") on an instance of Cucumber that isn't running (status: ${this.status}).\n This means you may have an invalid installation, potentially due to:\n - Cucumber being installed globally\n - A project structure where your support code is depending on a different instance of Cucumber\n Either way, you'll need to address this in order for Cucumber to work.\n See https://github.com/cucumber/cucumber-js/blob/main/docs/installation.md#invalid-installations\n `\n )\n }\n }\n this.methods = new Proxy(methods, {\n get(\n target: IDefineSupportCodeMethods,\n method: keyof IDefineSupportCodeMethods\n ): any {\n return (...args: any[]) => {\n checkInstall(method)\n // @ts-expect-error difficult to type this correctly\n return target[method](...args)\n }\n },\n })\n }\n\n defineParameterType(options: IParameterTypeDefinition<any>): void {\n const parameterType = buildParameterType(options)\n const source = getDefinitionLineAndUri(this.cwd)\n this.parameterTypeRegistry.defineSourcedParameterType(parameterType, source)\n }\n\n defineStep(\n keyword: GherkinStepKeyword,\n getCollection: () => IStepDefinitionConfig[]\n ): IDefineStep {\n return (\n pattern: DefineStepPattern,\n options: IDefineStepOptions | Function,\n code?: Function\n ) => {\n if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, pattern, options },\n fnName: 'defineStep',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n keyword,\n pattern,\n uri,\n })\n }\n }\n\n defineTestCaseHook(\n getCollection: () => ITestCaseHookDefinitionConfig[]\n ): <WorldType>(\n options:\n | string\n | IDefineTestCaseHookOptions\n | TestCaseHookFunction<WorldType>,\n code?: TestCaseHookFunction<WorldType>\n ) => void {\n return <WorldType>(\n options:\n | string\n | IDefineTestCaseHookOptions\n | TestCaseHookFunction<WorldType>,\n code?: TestCaseHookFunction<WorldType>\n ) => {\n if (typeof options === 'string') {\n options = { tags: options }\n } else if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestCaseHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n uri,\n })\n }\n }\n\n defineTestStepHook(\n getCollection: () => ITestStepHookDefinitionConfig[]\n ): <WorldType>(\n options:\n | string\n | IDefineTestStepHookOptions\n | TestStepHookFunction<WorldType>,\n code?: TestStepHookFunction<WorldType>\n ) => void {\n return <WorldType>(\n options:\n | string\n | IDefineTestStepHookOptions\n | TestStepHookFunction<WorldType>,\n code?: TestStepHookFunction<WorldType>\n ) => {\n if (typeof options === 'string') {\n options = { tags: options }\n } else if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestStepHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n uri,\n })\n }\n }\n\n defineTestRunHook(\n getCollection: () => ITestRunHookDefinitionConfig[]\n ): (options: IDefineTestRunHookOptions | Function, code?: Function) => void {\n return (options: IDefineTestRunHookOptions | Function, code?: Function) => {\n if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestRunHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n uri,\n })\n }\n }\n\n wrapCode({\n code,\n wrapperOptions,\n }: {\n code: Function\n wrapperOptions: any\n }): Function {\n if (doesHaveValue(this.definitionFunctionWrapper)) {\n const codeLength = code.length\n const wrappedCode = this.definitionFunctionWrapper(code, wrapperOptions)\n if (wrappedCode !== code) {\n return arity(codeLength, wrappedCode)\n }\n return wrappedCode\n }\n return code\n }\n\n buildTestCaseHookDefinitions(\n configs: ITestCaseHookDefinitionConfig[],\n canonicalIds?: string[]\n ): TestCaseHookDefinition[] {\n return configs.map(({ code, line, options, uri }, index) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestCaseHookDefinition({\n code: wrappedCode,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestStepHookDefinitions(\n configs: ITestStepHookDefinitionConfig[]\n ): TestStepHookDefinition[] {\n return configs.map(({ code, line, options, uri }) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestStepHookDefinition({\n code: wrappedCode,\n id: this.newId(),\n line,\n options,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestRunHookDefinitions(\n configs: ITestRunHookDefinitionConfig[]\n ): TestRunHookDefinition[] {\n return configs.map(({ code, line, options, uri }) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestRunHookDefinition({\n code: wrappedCode,\n id: this.newId(),\n line,\n options,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildStepDefinitions(canonicalIds?: string[]): {\n stepDefinitions: StepDefinition[]\n undefinedParameterTypes: messages.UndefinedParameterType[]\n } {\n const stepDefinitions: StepDefinition[] = []\n const undefinedParameterTypes: messages.UndefinedParameterType[] = []\n this.stepDefinitionConfigs.forEach(\n ({ code, line, options, keyword, pattern, uri }, index) => {\n let expression\n if (typeof pattern === 'string') {\n try {\n expression = new CucumberExpression(\n pattern,\n this.parameterTypeRegistry\n )\n } catch (e) {\n if (doesHaveValue(e.undefinedParameterTypeName)) {\n undefinedParameterTypes.push({\n name: e.undefinedParameterTypeName,\n expression: pattern,\n })\n return\n }\n throw e\n }\n } else {\n expression = new RegularExpression(\n pattern,\n this.parameterTypeRegistry\n )\n }\n\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n stepDefinitions.push(\n new StepDefinition({\n code: wrappedCode,\n expression,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options,\n keyword,\n pattern,\n unwrappedCode: code,\n uri,\n })\n )\n }\n )\n return { stepDefinitions, undefinedParameterTypes }\n }\n\n finalize(canonicalIds?: CanonicalSupportCodeIds): SupportCodeLibrary {\n this.status = 'FINALIZED'\n const stepDefinitionsResult = this.buildStepDefinitions(\n canonicalIds?.stepDefinitionIds\n )\n return {\n originalCoordinates: this.originalCoordinates,\n afterTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(\n this.afterTestCaseHookDefinitionConfigs,\n canonicalIds?.afterTestCaseHookDefinitionIds\n ),\n afterTestRunHookDefinitions: this.buildTestRunHookDefinitions(\n this.afterTestRunHookDefinitionConfigs\n ),\n afterTestStepHookDefinitions: this.buildTestStepHookDefinitions(\n this.afterTestStepHookDefinitionConfigs\n ),\n beforeTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(\n this.beforeTestCaseHookDefinitionConfigs,\n canonicalIds?.beforeTestCaseHookDefinitionIds\n ),\n beforeTestRunHookDefinitions: this.buildTestRunHookDefinitions(\n this.beforeTestRunHookDefinitionConfigs\n ),\n beforeTestStepHookDefinitions: this.buildTestStepHookDefinitions(\n this.beforeTestStepHookDefinitionConfigs\n ),\n defaultTimeout: this.defaultTimeout,\n parameterTypeRegistry: this.parameterTypeRegistry,\n undefinedParameterTypes: stepDefinitionsResult.undefinedParameterTypes,\n stepDefinitions: stepDefinitionsResult.stepDefinitions,\n World: this.World,\n parallelCanAssign: this.parallelCanAssign,\n }\n }\n\n reset(\n cwd: string,\n newId: IdGenerator.NewId,\n originalCoordinates: ISupportCodeCoordinates = {\n requireModules: [],\n requirePaths: [],\n importPaths: [],\n loaders: [],\n }\n ): void {\n this.cwd = cwd\n this.newId = newId\n this.originalCoordinates = originalCoordinates\n this.afterTestCaseHookDefinitionConfigs = []\n this.afterTestRunHookDefinitionConfigs = []\n this.afterTestStepHookDefinitionConfigs = []\n this.beforeTestCaseHookDefinitionConfigs = []\n this.beforeTestRunHookDefinitionConfigs = []\n this.beforeTestStepHookDefinitionConfigs = []\n this.definitionFunctionWrapper = null\n this.defaultTimeout = 5000\n this.parameterTypeRegistry = new SourcedParameterTypeRegistry()\n this.stepDefinitionConfigs = []\n this.parallelCanAssign = () => true\n this.World = World\n this.status = 'OPEN'\n }\n}\n\nexport default new SupportCodeLibraryBuilder()\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/support_code_library_builder/index.ts"],"names":[],"mappings":";;;;;;AAEA,4DAA8B;AAC9B,yEAGuC;AACvC,oGAAwE;AACxE,oGAAwE;AACxE,kGAAsE;AACtE,gFAAsD;AACtD,kDAAqD;AACrD,oDAAgD;AAEhD,8EAAoD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AAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;KACZ;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;QAC9C,IAAI,CAAC,kCAAkC,GAAG,EAAE,CAAA;QAC5C,IAAI,CAAC,iCAAiC,GAAG,EAAE,CAAA;QAC3C,IAAI,CAAC,kCAAkC,GAAG,EAAE,CAAA;QAC5C,IAAI,CAAC,mCAAmC,GAAG,EAAE,CAAA;QAC7C,IAAI,CAAC,kCAAkC,GAAG,EAAE,CAAA;QAC5C,IAAI,CAAC,mCAAmC,GAAG,EAAE,CAAA;QAC7C,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAA;QACrC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAA;QAC1B,IAAI,CAAC,qBAAqB,GAAG,IAAI,8DAA4B,EAAE,CAAA;QAC/D,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAA;QAC/B,IAAI,CAAC,iBAAiB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;QACnC,IAAI,CAAC,KAAK,GAAG,eAAK,CAAA;QAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AA3ZD,8DA2ZC;AAED,kBAAe,IAAI,yBAAyB,EAAE,CAAA","sourcesContent":["import { IdGenerator } from '@cucumber/messages'\nimport * as messages from '@cucumber/messages'\nimport arity from 'util-arity'\nimport {\n CucumberExpression,\n RegularExpression,\n} from '@cucumber/cucumber-expressions'\nimport TestCaseHookDefinition from '../models/test_case_hook_definition'\nimport TestStepHookDefinition from '../models/test_step_hook_definition'\nimport TestRunHookDefinition from '../models/test_run_hook_definition'\nimport StepDefinition from '../models/step_definition'\nimport { formatLocation } from '../formatter/helpers'\nimport { doesHaveValue } from '../value_checker'\nimport { GherkinStepKeyword } from '../models/gherkin_step_keyword'\nimport validateArguments from './validate_arguments'\n\nimport {\n DefineStepPattern,\n IDefineStepOptions,\n IDefineSupportCodeMethods,\n IDefineTestCaseHookOptions,\n IDefineTestStepHookOptions,\n IDefineTestRunHookOptions,\n IParameterTypeDefinition,\n SupportCodeLibrary,\n TestCaseHookFunction,\n TestStepHookFunction,\n ParallelAssignmentValidator,\n ISupportCodeCoordinates,\n IDefineStep,\n CanonicalSupportCodeIds,\n} from './types'\nimport World from './world'\nimport { getDefinitionLineAndUri } from './get_definition_line_and_uri'\nimport { buildParameterType } from './build_parameter_type'\nimport { SourcedParameterTypeRegistry } from './sourced_parameter_type_registry'\n\ninterface IStepDefinitionConfig {\n code: Function\n line: number\n options: any\n keyword: GherkinStepKeyword\n pattern: string | RegExp\n uri: string\n}\n\ninterface ITestCaseHookDefinitionConfig {\n code: any\n line: number\n options: any\n uri: string\n}\n\ninterface ITestStepHookDefinitionConfig {\n code: Function\n line: number\n options: any\n uri: string\n}\n\ninterface ITestRunHookDefinitionConfig {\n code: Function\n line: number\n options: any\n uri: string\n}\n\ntype LibraryStatus = 'PENDING' | 'OPEN' | 'FINALIZED'\n\nexport class SupportCodeLibraryBuilder {\n public readonly methods: IDefineSupportCodeMethods\n private originalCoordinates: ISupportCodeCoordinates\n private afterTestCaseHookDefinitionConfigs: ITestCaseHookDefinitionConfig[]\n private afterTestRunHookDefinitionConfigs: ITestRunHookDefinitionConfig[]\n private afterTestStepHookDefinitionConfigs: ITestStepHookDefinitionConfig[]\n private beforeTestCaseHookDefinitionConfigs: ITestCaseHookDefinitionConfig[]\n private beforeTestRunHookDefinitionConfigs: ITestRunHookDefinitionConfig[]\n private beforeTestStepHookDefinitionConfigs: ITestStepHookDefinitionConfig[]\n private cwd: string\n private defaultTimeout: number\n private definitionFunctionWrapper: any\n private newId: IdGenerator.NewId\n private parameterTypeRegistry: SourcedParameterTypeRegistry\n private stepDefinitionConfigs: IStepDefinitionConfig[]\n private World: any\n private parallelCanAssign: ParallelAssignmentValidator\n private status: LibraryStatus = 'PENDING'\n\n constructor() {\n const methods: IDefineSupportCodeMethods = {\n After: this.defineTestCaseHook(\n () => this.afterTestCaseHookDefinitionConfigs\n ),\n AfterAll: this.defineTestRunHook(\n () => this.afterTestRunHookDefinitionConfigs\n ),\n AfterStep: this.defineTestStepHook(\n () => this.afterTestStepHookDefinitionConfigs\n ),\n Before: this.defineTestCaseHook(\n () => this.beforeTestCaseHookDefinitionConfigs\n ),\n BeforeAll: this.defineTestRunHook(\n () => this.beforeTestRunHookDefinitionConfigs\n ),\n BeforeStep: this.defineTestStepHook(\n () => this.beforeTestStepHookDefinitionConfigs\n ),\n defineParameterType: this.defineParameterType.bind(this),\n defineStep: this.defineStep('Unknown', () => this.stepDefinitionConfigs),\n Given: this.defineStep('Given', () => this.stepDefinitionConfigs),\n setDefaultTimeout: (milliseconds) => {\n this.defaultTimeout = milliseconds\n },\n setDefinitionFunctionWrapper: (fn) => {\n this.definitionFunctionWrapper = fn\n },\n setWorldConstructor: (fn) => {\n this.World = fn\n },\n setParallelCanAssign: (fn: ParallelAssignmentValidator): void => {\n this.parallelCanAssign = fn\n },\n Then: this.defineStep('Then', () => this.stepDefinitionConfigs),\n When: this.defineStep('When', () => this.stepDefinitionConfigs),\n }\n const checkInstall = (method: string) => {\n if (this.status === 'PENDING') {\n throw new Error(\n `\n You're calling functions (e.g. \"${method}\") on an instance of Cucumber that isn't running (status: ${this.status}).\n This means you may have an invalid installation, potentially due to:\n - Cucumber being installed globally\n - A project structure where your support code is depending on a different instance of Cucumber\n Either way, you'll need to address this in order for Cucumber to work.\n See https://github.com/cucumber/cucumber-js/blob/main/docs/installation.md#invalid-installations\n `\n )\n }\n }\n this.methods = new Proxy(methods, {\n get(\n target: IDefineSupportCodeMethods,\n method: keyof IDefineSupportCodeMethods\n ): any {\n return (...args: any[]) => {\n checkInstall(method)\n // @ts-expect-error difficult to type this correctly\n return target[method](...args)\n }\n },\n })\n }\n\n defineParameterType(options: IParameterTypeDefinition<any>): void {\n const parameterType = buildParameterType(options)\n const source = getDefinitionLineAndUri(this.cwd)\n this.parameterTypeRegistry.defineSourcedParameterType(parameterType, source)\n }\n\n defineStep(\n keyword: GherkinStepKeyword,\n getCollection: () => IStepDefinitionConfig[]\n ): IDefineStep {\n return (\n pattern: DefineStepPattern,\n options: IDefineStepOptions | Function,\n code?: Function\n ) => {\n if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, pattern, options },\n fnName: 'defineStep',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n keyword,\n pattern,\n uri,\n })\n }\n }\n\n defineTestCaseHook(\n getCollection: () => ITestCaseHookDefinitionConfig[]\n ): <WorldType>(\n options:\n | string\n | IDefineTestCaseHookOptions\n | TestCaseHookFunction<WorldType>,\n code?: TestCaseHookFunction<WorldType>\n ) => void {\n return <WorldType>(\n options:\n | string\n | IDefineTestCaseHookOptions\n | TestCaseHookFunction<WorldType>,\n code?: TestCaseHookFunction<WorldType>\n ) => {\n if (typeof options === 'string') {\n options = { tags: options }\n } else if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestCaseHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n uri,\n })\n }\n }\n\n defineTestStepHook(\n getCollection: () => ITestStepHookDefinitionConfig[]\n ): <WorldType>(\n options:\n | string\n | IDefineTestStepHookOptions\n | TestStepHookFunction<WorldType>,\n code?: TestStepHookFunction<WorldType>\n ) => void {\n return <WorldType>(\n options:\n | string\n | IDefineTestStepHookOptions\n | TestStepHookFunction<WorldType>,\n code?: TestStepHookFunction<WorldType>\n ) => {\n if (typeof options === 'string') {\n options = { tags: options }\n } else if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestStepHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n uri,\n })\n }\n }\n\n defineTestRunHook(\n getCollection: () => ITestRunHookDefinitionConfig[]\n ): (options: IDefineTestRunHookOptions | Function, code?: Function) => void {\n return (options: IDefineTestRunHookOptions | Function, code?: Function) => {\n if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestRunHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n uri,\n })\n }\n }\n\n wrapCode({\n code,\n wrapperOptions,\n }: {\n code: Function\n wrapperOptions: any\n }): Function {\n if (doesHaveValue(this.definitionFunctionWrapper)) {\n const codeLength = code.length\n const wrappedCode = this.definitionFunctionWrapper(code, wrapperOptions)\n if (wrappedCode !== code) {\n return arity(codeLength, wrappedCode)\n }\n return wrappedCode\n }\n return code\n }\n\n buildTestCaseHookDefinitions(\n configs: ITestCaseHookDefinitionConfig[],\n canonicalIds?: string[]\n ): TestCaseHookDefinition[] {\n return configs.map(({ code, line, options, uri }, index) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestCaseHookDefinition({\n code: wrappedCode,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestStepHookDefinitions(\n configs: ITestStepHookDefinitionConfig[]\n ): TestStepHookDefinition[] {\n return configs.map(({ code, line, options, uri }) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestStepHookDefinition({\n code: wrappedCode,\n id: this.newId(),\n line,\n options,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestRunHookDefinitions(\n configs: ITestRunHookDefinitionConfig[]\n ): TestRunHookDefinition[] {\n return configs.map(({ code, line, options, uri }) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestRunHookDefinition({\n code: wrappedCode,\n id: this.newId(),\n line,\n options,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildStepDefinitions(canonicalIds?: string[]): {\n stepDefinitions: StepDefinition[]\n undefinedParameterTypes: messages.UndefinedParameterType[]\n } {\n const stepDefinitions: StepDefinition[] = []\n const undefinedParameterTypes: messages.UndefinedParameterType[] = []\n this.stepDefinitionConfigs.forEach(\n ({ code, line, options, keyword, pattern, uri }, index) => {\n let expression\n if (typeof pattern === 'string') {\n try {\n expression = new CucumberExpression(\n pattern,\n this.parameterTypeRegistry\n )\n } catch (e) {\n if (doesHaveValue(e.undefinedParameterTypeName)) {\n undefinedParameterTypes.push({\n name: e.undefinedParameterTypeName,\n expression: pattern,\n })\n return\n }\n throw e\n }\n } else {\n expression = new RegularExpression(\n pattern,\n this.parameterTypeRegistry\n )\n }\n\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n stepDefinitions.push(\n new StepDefinition({\n code: wrappedCode,\n expression,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options,\n keyword,\n pattern,\n unwrappedCode: code,\n uri,\n })\n )\n }\n )\n return { stepDefinitions, undefinedParameterTypes }\n }\n\n finalize(canonicalIds?: CanonicalSupportCodeIds): SupportCodeLibrary {\n this.status = 'FINALIZED'\n const stepDefinitionsResult = this.buildStepDefinitions(\n canonicalIds?.stepDefinitionIds\n )\n return {\n originalCoordinates: this.originalCoordinates,\n afterTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(\n this.afterTestCaseHookDefinitionConfigs,\n canonicalIds?.afterTestCaseHookDefinitionIds\n ),\n afterTestRunHookDefinitions: this.buildTestRunHookDefinitions(\n this.afterTestRunHookDefinitionConfigs\n ),\n afterTestStepHookDefinitions: this.buildTestStepHookDefinitions(\n this.afterTestStepHookDefinitionConfigs\n ),\n beforeTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(\n this.beforeTestCaseHookDefinitionConfigs,\n canonicalIds?.beforeTestCaseHookDefinitionIds\n ),\n beforeTestRunHookDefinitions: this.buildTestRunHookDefinitions(\n this.beforeTestRunHookDefinitionConfigs\n ),\n beforeTestStepHookDefinitions: this.buildTestStepHookDefinitions(\n this.beforeTestStepHookDefinitionConfigs\n ),\n defaultTimeout: this.defaultTimeout,\n parameterTypeRegistry: this.parameterTypeRegistry,\n undefinedParameterTypes: stepDefinitionsResult.undefinedParameterTypes,\n stepDefinitions: stepDefinitionsResult.stepDefinitions,\n World: this.World,\n parallelCanAssign: this.parallelCanAssign,\n }\n }\n\n reset(\n cwd: string,\n newId: IdGenerator.NewId,\n originalCoordinates: ISupportCodeCoordinates = {\n requireModules: [],\n requirePaths: [],\n importPaths: [],\n loaders: [],\n }\n ): void {\n this.cwd = cwd\n this.newId = newId\n this.originalCoordinates = originalCoordinates\n this.afterTestCaseHookDefinitionConfigs = []\n this.afterTestRunHookDefinitionConfigs = []\n this.afterTestStepHookDefinitionConfigs = []\n this.beforeTestCaseHookDefinitionConfigs = []\n this.beforeTestRunHookDefinitionConfigs = []\n this.beforeTestStepHookDefinitionConfigs = []\n this.definitionFunctionWrapper = null\n this.defaultTimeout = 5000\n this.parameterTypeRegistry = new SourcedParameterTypeRegistry()\n this.stepDefinitionConfigs = []\n this.parallelCanAssign = () => true\n this.World = World\n this.status = 'OPEN'\n }\n}\n\nexport default new SupportCodeLibraryBuilder()\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.atMostOnePicklePerTag = void 0;
3
+ exports.atMostOnePicklePerTag = atMostOnePicklePerTag;
4
4
  function hasTag(pickle, tagName) {
5
5
  return pickle.tags.some((t) => t.name == tagName);
6
6
  }
@@ -12,5 +12,4 @@ function atMostOnePicklePerTag(tagNames) {
12
12
  });
13
13
  };
14
14
  }
15
- exports.atMostOnePicklePerTag = atMostOnePicklePerTag;
16
15
  //# sourceMappingURL=parallel_can_assign_helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parallel_can_assign_helpers.js","sourceRoot":"","sources":["../../src/support_code_library_builder/parallel_can_assign_helpers.ts"],"names":[],"mappings":";;;AAGA,SAAS,MAAM,CAAC,MAAuB,EAAE,OAAe;IACtD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAA;AACnD,CAAC;AAED,SAAgB,qBAAqB,CACnC,QAAkB;IAElB,OAAO,CAAC,UAA2B,EAAE,UAA6B,EAAE,EAAE;QACpE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChC,OAAO,CACL,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC;gBAC5B,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAC7C,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC;AAXD,sDAWC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { ParallelAssignmentValidator } from './types'\n\nfunction hasTag(pickle: messages.Pickle, tagName: string): boolean {\n return pickle.tags.some((t) => t.name == tagName)\n}\n\nexport function atMostOnePicklePerTag(\n tagNames: string[]\n): ParallelAssignmentValidator {\n return (inQuestion: messages.Pickle, inProgress: messages.Pickle[]) => {\n return tagNames.every((tagName) => {\n return (\n !hasTag(inQuestion, tagName) ||\n inProgress.every((p) => !hasTag(p, tagName))\n )\n })\n }\n}\n"]}
1
+ {"version":3,"file":"parallel_can_assign_helpers.js","sourceRoot":"","sources":["../../src/support_code_library_builder/parallel_can_assign_helpers.ts"],"names":[],"mappings":";;AAOA,sDAWC;AAfD,SAAS,MAAM,CAAC,MAAuB,EAAE,OAAe;IACtD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAA;AACnD,CAAC;AAED,SAAgB,qBAAqB,CACnC,QAAkB;IAElB,OAAO,CAAC,UAA2B,EAAE,UAA6B,EAAE,EAAE;QACpE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChC,OAAO,CACL,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC;gBAC5B,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAC7C,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { ParallelAssignmentValidator } from './types'\n\nfunction hasTag(pickle: messages.Pickle, tagName: string): boolean {\n return pickle.tags.some((t) => t.name == tagName)\n}\n\nexport function atMostOnePicklePerTag(\n tagNames: string[]\n): ParallelAssignmentValidator {\n return (inQuestion: messages.Pickle, inProgress: messages.Pickle[]) => {\n return tagNames.every((tagName) => {\n return (\n !hasTag(inQuestion, tagName) ||\n inProgress.every((p) => !hasTag(p, tagName))\n )\n })\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = validateArguments;
3
4
  const optionsValidation = {
4
5
  expectedType: 'object or function',
5
6
  predicate({ options }) {
@@ -69,5 +70,4 @@ function validateArguments({ args, fnName, location, }) {
69
70
  }
70
71
  });
71
72
  }
72
- exports.default = validateArguments;
73
73
  //# sourceMappingURL=validate_arguments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate_arguments.js","sourceRoot":"","sources":["../../src/support_code_library_builder/validate_arguments.ts"],"names":[],"mappings":";;AAcA,MAAM,iBAAiB,GAAG;IACxB,YAAY,EAAE,oBAAoB;IAClC,SAAS,CAAC,EAAE,OAAO,EAAwB;QACzC,OAAO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AAA;YACjE,CAAC;SACF;QACD,wBAAwB;QACxB,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE;KACnD;IACD,UAAU,EAAE;QACV;YACE,UAAU,EAAE,gBAAgB;YAC5B,YAAY,EAAE,8BAA8B;YAC5C,SAAS,CAAC,EAAE,OAAO,EAAE;gBACnB,OAAO,OAAO,YAAY,MAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAA;YACjE,CAAC;SACF;QACD,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE;QACvD,wBAAwB;QACxB,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,YAAY,EAAE;KAClD;CACF,CAAA;AAED,SAAwB,iBAAiB,CAAC,EACxC,IAAI,EACJ,MAAM,EACN,QAAQ,GAKT;IACC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE;QACtE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;YACpB,MAAM,IAAI,KAAK,CACb,GAAG,QAAQ,aAAa,UAAU,iBAAiB,YAAY,EAAE,CAClE,CAAA;SACF;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAhBD,oCAgBC","sourcesContent":["import { DefineStepPattern, IDefineStepOptions } from './types'\n\ninterface IValidation {\n identifier: string\n expectedType: string\n predicate: (args: any) => boolean\n}\n\ninterface IDefineStepArguments {\n pattern?: DefineStepPattern\n options?: IDefineStepOptions\n code?: Function\n}\n\nconst optionsValidation = {\n expectedType: 'object or function',\n predicate({ options }: IDefineStepArguments) {\n return typeof options === 'object'\n },\n}\n\nconst optionsTimeoutValidation = {\n identifier: '\"options.timeout\"',\n expectedType: 'integer',\n predicate({ options }: IDefineStepArguments) {\n return options.timeout == null || typeof options.timeout === 'number'\n },\n}\n\nconst fnValidation = {\n expectedType: 'function',\n predicate({ code }: IDefineStepArguments) {\n return typeof code === 'function'\n },\n}\n\nconst validations: Record<string, IValidation[]> = {\n defineTestRunHook: [\n { identifier: 'first argument', ...optionsValidation },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineTestCaseHook: [\n { identifier: 'first argument', ...optionsValidation },\n {\n identifier: '\"options.tags\"',\n expectedType: 'string',\n predicate({ options }) {\n return options.tags == null || typeof options.tags === 'string'\n },\n },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineTestStepHook: [\n { identifier: 'first argument', ...optionsValidation },\n {\n identifier: '\"options.tags\"',\n expectedType: 'string',\n predicate({ options }) {\n return options.tags == null || typeof options.tags === 'string'\n },\n },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineStep: [\n {\n identifier: 'first argument',\n expectedType: 'string or regular expression',\n predicate({ pattern }) {\n return pattern instanceof RegExp || typeof pattern === 'string'\n },\n },\n { identifier: 'second argument', ...optionsValidation },\n optionsTimeoutValidation,\n { identifier: 'third argument', ...fnValidation },\n ],\n}\n\nexport default function validateArguments({\n args,\n fnName,\n location,\n}: {\n args?: IDefineStepArguments\n fnName: string\n location: string\n}): void {\n validations[fnName].forEach(({ identifier, expectedType, predicate }) => {\n if (!predicate(args)) {\n throw new Error(\n `${location}: Invalid ${identifier}: should be a ${expectedType}`\n )\n }\n })\n}\n"]}
1
+ {"version":3,"file":"validate_arguments.js","sourceRoot":"","sources":["../../src/support_code_library_builder/validate_arguments.ts"],"names":[],"mappings":";;AAgFA,oCAgBC;AAlFD,MAAM,iBAAiB,GAAG;IACxB,YAAY,EAAE,oBAAoB;IAClC,SAAS,CAAC,EAAE,OAAO,EAAwB;QACzC,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAA;IACpC,CAAC;CACF,CAAA;AAED,MAAM,wBAAwB,GAAG;IAC/B,UAAU,EAAE,mBAAmB;IAC/B,YAAY,EAAE,SAAS;IACvB,SAAS,CAAC,EAAE,OAAO,EAAwB;QACzC,OAAO,O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,CAAC,EAAE,OAAO,EAAE;gBACnB,OAAO,OAAO,YAAY,MAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAA;YACjE,CAAC;SACF;QACD,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE;QACvD,wBAAwB;QACxB,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,YAAY,EAAE;KAClD;CACF,CAAA;AAED,SAAwB,iBAAiB,CAAC,EACxC,IAAI,EACJ,MAAM,EACN,QAAQ,GAKT;IACC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE;QACtE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,GAAG,QAAQ,aAAa,UAAU,iBAAiB,YAAY,EAAE,CAClE,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { DefineStepPattern, IDefineStepOptions } from './types'\n\ninterface IValidation {\n identifier: string\n expectedType: string\n predicate: (args: any) => boolean\n}\n\ninterface IDefineStepArguments {\n pattern?: DefineStepPattern\n options?: IDefineStepOptions\n code?: Function\n}\n\nconst optionsValidation = {\n expectedType: 'object or function',\n predicate({ options }: IDefineStepArguments) {\n return typeof options === 'object'\n },\n}\n\nconst optionsTimeoutValidation = {\n identifier: '\"options.timeout\"',\n expectedType: 'integer',\n predicate({ options }: IDefineStepArguments) {\n return options.timeout == null || typeof options.timeout === 'number'\n },\n}\n\nconst fnValidation = {\n expectedType: 'function',\n predicate({ code }: IDefineStepArguments) {\n return typeof code === 'function'\n },\n}\n\nconst validations: Record<string, IValidation[]> = {\n defineTestRunHook: [\n { identifier: 'first argument', ...optionsValidation },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineTestCaseHook: [\n { identifier: 'first argument', ...optionsValidation },\n {\n identifier: '\"options.tags\"',\n expectedType: 'string',\n predicate({ options }) {\n return options.tags == null || typeof options.tags === 'string'\n },\n },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineTestStepHook: [\n { identifier: 'first argument', ...optionsValidation },\n {\n identifier: '\"options.tags\"',\n expectedType: 'string',\n predicate({ options }) {\n return options.tags == null || typeof options.tags === 'string'\n },\n },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineStep: [\n {\n identifier: 'first argument',\n expectedType: 'string or regular expression',\n predicate({ pattern }) {\n return pattern instanceof RegExp || typeof pattern === 'string'\n },\n },\n { identifier: 'second argument', ...optionsValidation },\n optionsTimeoutValidation,\n { identifier: 'third argument', ...fnValidation },\n ],\n}\n\nexport default function validateArguments({\n args,\n fnName,\n location,\n}: {\n args?: IDefineStepArguments\n fnName: string\n location: string\n}): void {\n validations[fnName].forEach(({ identifier, expectedType, predicate }) => {\n if (!predicate(args)) {\n throw new Error(\n `${location}: Invalid ${identifier}: should be a ${expectedType}`\n )\n }\n })\n}\n"]}
package/lib/time.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { performance } from 'node:perf_hooks';
4
2
  import * as messages from '@cucumber/messages';
5
3
  interface ProtectedTimingBuiltins {
package/lib/time.js CHANGED
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.wrapPromiseWithTimeout = exports.durationBetweenTimestamps = void 0;
36
+ exports.durationBetweenTimestamps = durationBetweenTimestamps;
37
+ exports.wrapPromiseWithTimeout = wrapPromiseWithTimeout;
27
38
  const node_perf_hooks_1 = require("node:perf_hooks");
28
39
  const messages = __importStar(require("@cucumber/messages"));
29
40
  const methods = {
@@ -43,7 +54,6 @@ function durationBetweenTimestamps(startedTimestamp, finishedTimestamp) {
43
54
  messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp);
44
55
  return messages.TimeConversion.millisecondsToDuration(durationMillis);
45
56
  }
46
- exports.durationBetweenTimestamps = durationBetweenTimestamps;
47
57
  async function wrapPromiseWithTimeout(promise, timeoutInMilliseconds, timeoutMessage = '') {
48
58
  let timeoutId;
49
59
  if (timeoutMessage === '') {
@@ -56,6 +66,5 @@ async function wrapPromiseWithTimeout(promise, timeoutInMilliseconds, timeoutMes
56
66
  });
57
67
  return await Promise.race([promise, timeoutPromise]).finally(() => methods.clearTimeout(timeoutId));
58
68
  }
59
- exports.wrapPromiseWithTimeout = wrapPromiseWithTimeout;
60
69
  exports.default = methods;
61
70
  //# sourceMappingURL=time.js.map
package/lib/time.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,6DAA8C;AAa9C,MAAM,OAAO,GAAqC;IAChD,aAAa,EAAE,aAAa,CA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,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAChE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAChC,CAAA;AACH,CAAC;AAjBD,wDAiBC;AAED,kBAAe,OAAO,CAAA","sourcesContent":["import { performance } from 'node:perf_hooks'\nimport * as messages from '@cucumber/messages'\n\ninterface ProtectedTimingBuiltins {\n clearImmediate: typeof clearImmediate\n clearInterval: typeof clearInterval\n clearTimeout: typeof clearTimeout\n Date: typeof Date\n setImmediate: typeof setImmediate\n setInterval: typeof setInterval\n setTimeout: typeof setTimeout\n performance: typeof performance\n}\n\nconst methods: Partial<ProtectedTimingBuiltins> = {\n clearInterval: clearInterval.bind(global),\n clearTimeout: clearTimeout.bind(global),\n Date,\n setInterval: setInterval.bind(global),\n setTimeout: setTimeout.bind(global),\n performance,\n}\n\nif (typeof setImmediate !== 'undefined') {\n methods.setImmediate = setImmediate.bind(global)\n methods.clearImmediate = clearImmediate.bind(global)\n}\n\nexport function durationBetweenTimestamps(\n startedTimestamp: messages.Timestamp,\n finishedTimestamp: messages.Timestamp\n): messages.Duration {\n const durationMillis =\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(\n finishedTimestamp\n ) -\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp)\n return messages.TimeConversion.millisecondsToDuration(durationMillis)\n}\n\nexport async function wrapPromiseWithTimeout<T>(\n promise: Promise<T>,\n timeoutInMilliseconds: number,\n timeoutMessage: string = ''\n): Promise<T> {\n let timeoutId: ReturnType<typeof setTimeout>\n if (timeoutMessage === '') {\n timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`\n }\n const timeoutPromise = new Promise<T>((resolve, reject) => {\n timeoutId = methods.setTimeout(() => {\n reject(new Error(timeoutMessage))\n }, timeoutInMilliseconds)\n })\n return await Promise.race([promise, timeoutPromise]).finally(() =>\n methods.clearTimeout(timeoutId)\n )\n}\n\nexport default methods\n"]}
1
+ {"version":3,"file":"time.js","sourceRoot":"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,EAAE;YAClC,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;QACnC,CAAC,EAAE,qBAAqB,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAChE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAChC,CAAA;AACH,CAAC;AAED,kBAAe,OAAO,CAAA","sourcesContent":["import { performance } from 'node:perf_hooks'\nimport * as messages from '@cucumber/messages'\n\ninterface ProtectedTimingBuiltins {\n clearImmediate: typeof clearImmediate\n clearInterval: typeof clearInterval\n clearTimeout: typeof clearTimeout\n Date: typeof Date\n setImmediate: typeof setImmediate\n setInterval: typeof setInterval\n setTimeout: typeof setTimeout\n performance: typeof performance\n}\n\nconst methods: Partial<ProtectedTimingBuiltins> = {\n clearInterval: clearInterval.bind(global),\n clearTimeout: clearTimeout.bind(global),\n Date,\n setInterval: setInterval.bind(global),\n setTimeout: setTimeout.bind(global),\n performance,\n}\n\nif (typeof setImmediate !== 'undefined') {\n methods.setImmediate = setImmediate.bind(global)\n methods.clearImmediate = clearImmediate.bind(global)\n}\n\nexport function durationBetweenTimestamps(\n startedTimestamp: messages.Timestamp,\n finishedTimestamp: messages.Timestamp\n): messages.Duration {\n const durationMillis =\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(\n finishedTimestamp\n ) -\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp)\n return messages.TimeConversion.millisecondsToDuration(durationMillis)\n}\n\nexport async function wrapPromiseWithTimeout<T>(\n promise: Promise<T>,\n timeoutInMilliseconds: number,\n timeoutMessage: string = ''\n): Promise<T> {\n let timeoutId: ReturnType<typeof setTimeout>\n if (timeoutMessage === '') {\n timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`\n }\n const timeoutPromise = new Promise<T>((resolve, reject) => {\n timeoutId = methods.setTimeout(() => {\n reject(new Error(timeoutMessage))\n }, timeoutInMilliseconds)\n })\n return await Promise.race([promise, timeoutPromise]).finally(() =>\n methods.clearTimeout(timeoutId)\n )\n}\n\nexport default methods\n"]}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = tryRequire;
3
4
  /**
4
5
  * Provides a try guarded require call that will throw a more detailed error when
5
6
  * the ERR_REQUIRE_ESM error code is encountered.
@@ -24,5 +25,4 @@ function tryRequire(path) {
24
25
  }
25
26
  }
26
27
  }
27
- exports.default = tryRequire;
28
28
  //# sourceMappingURL=try_require.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"try_require.js","sourceRoot":"","sources":["../src/try_require.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,SAAwB,UAAU,CAAC,IAAY;IAC7C,IAAI;QACF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;KACrB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE;YACpC,MAAM,KAAK,CACT,2CAA2C,IAAI;oGAC6C,EAC5F,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;SACF;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,0BAA0B,EAAE;YACpD,MAAM,KAAK,CACT,+DAA+D,IAAI;uGAC4B,EAC/F,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;SACF;aAAM;YACL,MAAM,KAAK,CAAA;SACZ;KACF;AACH,CAAC;AApBD,6BAoBC","sourcesContent":["/**\n * Provides a try guarded require call that will throw a more detailed error when\n * the ERR_REQUIRE_ESM error code is encountered.\n *\n * @param {string} path File path to require from.\n */\nexport default function tryRequire(path: string) {\n try {\n return require(path)\n } catch (error) {\n if (error.code === 'ERR_REQUIRE_ESM') {\n throw Error(\n `Cucumber expected a CommonJS module at '${path}' but found an ES module.\n Either change the file to CommonJS syntax or use the --import directive instead of --require.`,\n { cause: error }\n )\n } else if (error.code === 'ERR_REQUIRE_ASYNC_MODULE') {\n throw Error(\n `Cucumber expected a CommonJS module or simple ES module at '${path}' but found an async ES module.\n Either change the file so it can be required or use the --import directive instead of --require.`,\n { cause: error }\n )\n } else {\n throw error\n }\n }\n}\n"]}
1
+ {"version":3,"file":"try_require.js","sourceRoot":"","sources":["../src/try_require.ts"],"names":[],"mappings":";;AAMA,6BAoBC;AA1BD;;;;;GAKG;AACH,SAAwB,UAAU,CAAC,IAAY;IAC7C,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YACrC,MAAM,KAAK,CACT,2CAA2C,IAAI;oGAC6C,EAC5F,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,0BAA0B,EAAE,CAAC;YACrD,MAAM,KAAK,CACT,+DAA+D,IAAI;uGAC4B,EAC/F,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;QACH,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/**\n * Provides a try guarded require call that will throw a more detailed error when\n * the ERR_REQUIRE_ESM error code is encountered.\n *\n * @param {string} path File path to require from.\n */\nexport default function tryRequire(path: string) {\n try {\n return require(path)\n } catch (error) {\n if (error.code === 'ERR_REQUIRE_ESM') {\n throw Error(\n `Cucumber expected a CommonJS module at '${path}' but found an ES module.\n Either change the file to CommonJS syntax or use the --import directive instead of --require.`,\n { cause: error }\n )\n } else if (error.code === 'ERR_REQUIRE_ASYNC_MODULE') {\n throw Error(\n `Cucumber expected a CommonJS module or simple ES module at '${path}' but found an async ES module.\n Either change the file so it can be required or use the --import directive instead of --require.`,\n { cause: error }\n )\n } else {\n throw error\n }\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"root":["../src/filter_stack_trace.ts","../src/index.ts","../src/pickle_filter.ts","../src/step_arguments.ts","../src/time.ts","../src/try_require.ts","../src/uncaught_exception_manager.ts","../src/user_code_runner.ts","../src/value_checker.ts","../src/version.ts","../src/api/convert_configuration.ts","../src/api/formatters.ts","../src/api/gherkin.ts","../src/api/index.ts","../src/api/load_configuration.ts","../src/api/load_sources.ts","../src/api/load_support.ts","../src/api/plugins.ts","../src/api/run_cucumber.ts","../src/api/support.ts","../src/api/test_helpers.ts","../src/api/types.ts","../src/assemble/assemble_test_cases.ts","../src/assemble/index.ts","../src/assemble/types.ts","../src/cli/helpers.ts","../src/cli/i18n.ts","../src/cli/index.ts","../src/cli/install_validator.ts","../src/cli/run.ts","../src/cli/validate_node_engine_version.ts","../src/configuration/argv_parser.ts","../src/configuration/check_schema.ts","../src/configuration/default_configuration.ts","../src/configuration/from_file.ts","../src/configuration/helpers.ts","../src/configuration/index.ts","../src/configuration/locate_file.ts","../src/configuration/merge_configurations.ts","../src/configuration/parse_configuration.ts","../src/configuration/split_format_descriptor.ts","../src/configuration/types.ts","../src/configuration/validate_configuration.ts","../src/environment/console_logger.ts","../src/environment/index.ts","../src/environment/make_environment.ts","../src/environment/types.ts","../src/filter/filter_plugin.ts","../src/filter/index.ts","../src/filter/types.ts","../src/formatter/builder.ts","../src/formatter/create_stream.ts","../src/formatter/find_class_or_plugin.ts","../src/formatter/get_color_fns.ts","../src/formatter/import_code.ts","../src/formatter/index.ts","../src/formatter/json_formatter.ts","../src/formatter/progress_bar_formatter.ts","../src/formatter/progress_formatter.ts","../src/formatter/rerun_formatter.ts","../src/formatter/resolve_implementation.ts","../src/formatter/snippets_formatter.ts","../src/formatter/summary_formatter.ts","../src/formatter/usage_formatter.ts","../src/formatter/usage_json_formatter.ts","../src/formatter/builtin/html.ts","../src/formatter/builtin/index.ts","../src/formatter/builtin/message.ts","../src/formatter/helpers/duration_helpers.ts","../src/formatter/helpers/event_data_collector.ts","../src/formatter/helpers/formatters.ts","../src/formatter/helpers/gherkin_document_parser.ts","../src/formatter/helpers/index.ts","../src/formatter/helpers/issue_helpers.ts","../src/formatter/helpers/keyword_type.ts","../src/formatter/helpers/location_helpers.ts","../src/formatter/helpers/pickle_parser.ts","../src/formatter/helpers/step_argument_formatter.ts","../src/formatter/helpers/summary_helpers.ts","../src/formatter/helpers/test_case_attempt_formatter.ts","../src/formatter/helpers/test_case_attempt_parser.ts","../src/formatter/helpers/usage_helpers/index.ts","../src/formatter/step_definition_snippet_builder/index.ts","../src/formatter/step_definition_snippet_builder/javascript_snippet_syntax.ts","../src/formatter/step_definition_snippet_builder/snippet_syntax.ts","../src/models/data_table.ts","../src/models/definition.ts","../src/models/gherkin_step_keyword.ts","../src/models/step_definition.ts","../src/models/test_case_hook_definition.ts","../src/models/test_run_hook_definition.ts","../src/models/test_step_hook_definition.ts","../src/paths/index.ts","../src/paths/paths.ts","../src/paths/types.ts","../src/plugin/events.ts","../src/plugin/index.ts","../src/plugin/plugin_manager.ts","../src/plugin/types.ts","../src/publish/index.ts","../src/publish/publish_plugin.ts","../src/publish/types.ts","../src/runtime/coordinator.ts","../src/runtime/format_error.ts","../src/runtime/helpers.ts","../src/runtime/index.ts","../src/runtime/make_runtime.ts","../src/runtime/run_test_run_hooks.ts","../src/runtime/step_runner.ts","../src/runtime/stopwatch.ts","../src/runtime/test_case_runner.ts","../src/runtime/types.ts","../src/runtime/worker.ts","../src/runtime/attachment_manager/index.ts","../src/runtime/parallel/adapter.ts","../src/runtime/parallel/run_worker.ts","../src/runtime/parallel/types.ts","../src/runtime/parallel/worker.ts","../src/runtime/scope/index.ts","../src/runtime/scope/make_proxy.ts","../src/runtime/scope/test_case_scope.ts","../src/runtime/scope/test_run_scope.ts","../src/runtime/serial/adapter.ts","../src/support_code_library_builder/build_parameter_type.ts","../src/support_code_library_builder/context.ts","../src/support_code_library_builder/get_definition_line_and_uri.ts","../src/support_code_library_builder/index.ts","../src/support_code_library_builder/parallel_can_assign_helpers.ts","../src/support_code_library_builder/sourced_parameter_type_registry.ts","../src/support_code_library_builder/types.ts","../src/support_code_library_builder/validate_arguments.ts","../src/support_code_library_builder/world.ts","../src/types/index.ts","../src/types/assertion-error-formatter/index.d.ts","../src/types/is-generator/index.d.ts","../src/types/knuth-shuffle-seeded/index.d.ts","../src/types/stack-chain/index.d.ts","../src/types/supports-color/index.d.ts"],"version":"5.8.3"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import UncaughtExceptionListener = NodeJS.UncaughtExceptionListener;
3
2
  declare const UncaughtExceptionManager: {
4
3
  registerHandler(handler: UncaughtExceptionListener): void;
@@ -1 +1 @@
1
- {"version":3,"file":"user_code_runner.js","sourceRoot":"","sources":["../src/user_code_runner.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAC5B,iCAA+C;AAC/C,8FAAmE;AACnE,mDAA+C;AAc/C,MAAM,cAAc,GAAG;IACrB,KAAK,CAAC,GAAG,CAAC,EACR,SAAS,EACT,OAAO,EACP,EAAE,EACF,qBAAqB,GACT;QACZ,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAY,EAAE,MAAoB,EAAE,EAAE;gBACpD,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,EAAE;oBACxB,MAAM,CAAC,KAAK,CAAC,CAAA;iBACd;qBAAM;oBACL,OAAO,CAAC,MAAM,CAAC,CAAA;iBAChB;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAA;QACZ,IAAI;YACF,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC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eAAe,CAAA;YAC5D,YAAY,GAAG,IAAA,6BAAsB,EACnC,YAAY,EACZ,qBAAqB,EACrB,cAAc,CACf,CAAA;SACF;QAED,IAAI,KAAK,EAAE,MAAM,CAAA;QACjB,IAAI;YACF,MAAM,GAAG,MAAM,YAAY,CAAA;SAC5B;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,KAAK,GAAG,CAAC,CAAA;aACV;iBAAM,IAAI,IAAA,6BAAa,EAAC,CAAC,CAAC,EAAE;gBAC3B,KAAK,GAAG,mBAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;aACvB;iBAAM;gBACL,KAAK,GAAG,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;aACvD;SACF;QAED,oCAAwB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA;QAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import util from 'node:util'\nimport { wrapPromiseWithTimeout } from './time'\nimport UncaughtExceptionManager from './uncaught_exception_manager'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IRunRequest {\n argsArray: any[]\n thisArg: any\n fn: Function\n timeoutInMilliseconds: number\n}\n\nexport interface IRunResponse {\n error?: any\n result?: any\n}\n\nconst UserCodeRunner = {\n async run({\n argsArray,\n thisArg,\n fn,\n timeoutInMilliseconds,\n }: IRunRequest): Promise<IRunResponse> {\n const callbackPromise = new Promise((resolve, reject) => {\n argsArray.push((error: Error, result: IRunResponse) => {\n if (doesHaveValue(error)) {\n reject(error)\n } else {\n resolve(result)\n }\n })\n })\n\n let fnReturn\n try {\n fnReturn = fn.apply(thisArg, argsArray)\n } catch (e) {\n const error = e instanceof Error ? e : util.format(e)\n return { error }\n }\n\n const racingPromises = []\n const callbackInterface = fn.length === argsArray.length\n const promiseInterface =\n doesHaveValue(fnReturn) && typeof fnReturn.then === 'function'\n\n if (callbackInterface && promiseInterface) {\n return {\n error: new Error(\n 'function uses multiple asynchronous interfaces: callback and promise\\n' +\n 'to use the callback interface: do not return a promise\\n' +\n 'to use the promise interface: remove the last argument to the function'\n ),\n }\n } else if (callbackInterface) {\n racingPromises.push(callbackPromise)\n } else if (promiseInterface) {\n racingPromises.push(fnReturn)\n } else {\n return { result: fnReturn }\n }\n\n let exceptionHandler\n const uncaughtExceptionPromise = new Promise((resolve, reject) => {\n exceptionHandler = reject\n UncaughtExceptionManager.registerHandler(exceptionHandler)\n })\n racingPromises.push(uncaughtExceptionPromise)\n\n let finalPromise = Promise.race(racingPromises)\n if (timeoutInMilliseconds >= 0) {\n const timeoutMessage =\n 'function timed out, ensure the ' +\n (callbackInterface ? 'callback is executed' : 'promise resolves') +\n ` within ${timeoutInMilliseconds.toString()} milliseconds`\n finalPromise = wrapPromiseWithTimeout(\n finalPromise,\n timeoutInMilliseconds,\n timeoutMessage\n )\n }\n\n let error, result\n try {\n result = await finalPromise\n } catch (e) {\n if (e instanceof Error) {\n error = e\n } else if (doesHaveValue(e)) {\n error = util.format(e)\n } else {\n error = new Error('Promise rejected without a reason')\n }\n }\n\n UncaughtExceptionManager.unregisterHandler(exceptionHandler)\n\n return { error, result }\n },\n}\n\nexport default UserCodeRunner\n"]}
1
+ {"version":3,"file":"user_code_runner.js","sourceRoot":"","sources":["../src/user_code_runner.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAC5B,iCAA+C;AAC/C,8FAAmE;AACnE,mDAA+C;AAc/C,MAAM,cAAc,GAAG;IACrB,KAAK,CAAC,GAAG,CAAC,EACR,SAAS,EACT,OAAO,EACP,EAAE,EACF,qBAAqB,GACT;QACZ,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAY,EAAE,MAAoB,EAAE,EAAE;gBACpD,IAAI,IAAA,6BAAa,EAAC,KAAK,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OAAO,EAAE,MAAM,EAAE,EAAE;YAC/D,gBAAgB,GAAG,MAAM,CAAA;YACzB,oCAAwB,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAA;QACF,cAAc,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;QAE7C,IAAI,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC/C,IAAI,qBAAqB,IAAI,CAAC,EAAE,CAAC;YAC/B,MAAM,cAAc,GAClB,iCAAiC;gBACjC,CAAC,iBAAiB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,kBAAkB,CAAC;gBACjE,WAAW,qBAAqB,CAAC,QAAQ,EAAE,eAAe,CAAA;YAC5D,YAAY,GAAG,IAAA,6BAAsB,EACnC,YAAY,EACZ,qBAAqB,EACrB,cAAc,CACf,CAAA;QACH,CAAC;QAED,IAAI,KAAK,EAAE,MAAM,CAAA;QACjB,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,YAAY,CAAA;QAC7B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;gBACvB,KAAK,GAAG,CAAC,CAAA;YACX,CAAC;iBAAM,IAAI,IAAA,6BAAa,EAAC,CAAC,CAAC,EAAE,CAAC;gBAC5B,KAAK,GAAG,mBAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACxB,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;YACxD,CAAC;QACH,CAAC;QAED,oCAAwB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA;QAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import util from 'node:util'\nimport { wrapPromiseWithTimeout } from './time'\nimport UncaughtExceptionManager from './uncaught_exception_manager'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IRunRequest {\n argsArray: any[]\n thisArg: any\n fn: Function\n timeoutInMilliseconds: number\n}\n\nexport interface IRunResponse {\n error?: any\n result?: any\n}\n\nconst UserCodeRunner = {\n async run({\n argsArray,\n thisArg,\n fn,\n timeoutInMilliseconds,\n }: IRunRequest): Promise<IRunResponse> {\n const callbackPromise = new Promise((resolve, reject) => {\n argsArray.push((error: Error, result: IRunResponse) => {\n if (doesHaveValue(error)) {\n reject(error)\n } else {\n resolve(result)\n }\n })\n })\n\n let fnReturn\n try {\n fnReturn = fn.apply(thisArg, argsArray)\n } catch (e) {\n const error = e instanceof Error ? e : util.format(e)\n return { error }\n }\n\n const racingPromises = []\n const callbackInterface = fn.length === argsArray.length\n const promiseInterface =\n doesHaveValue(fnReturn) && typeof fnReturn.then === 'function'\n\n if (callbackInterface && promiseInterface) {\n return {\n error: new Error(\n 'function uses multiple asynchronous interfaces: callback and promise\\n' +\n 'to use the callback interface: do not return a promise\\n' +\n 'to use the promise interface: remove the last argument to the function'\n ),\n }\n } else if (callbackInterface) {\n racingPromises.push(callbackPromise)\n } else if (promiseInterface) {\n racingPromises.push(fnReturn)\n } else {\n return { result: fnReturn }\n }\n\n let exceptionHandler\n const uncaughtExceptionPromise = new Promise((resolve, reject) => {\n exceptionHandler = reject\n UncaughtExceptionManager.registerHandler(exceptionHandler)\n })\n racingPromises.push(uncaughtExceptionPromise)\n\n let finalPromise = Promise.race(racingPromises)\n if (timeoutInMilliseconds >= 0) {\n const timeoutMessage =\n 'function timed out, ensure the ' +\n (callbackInterface ? 'callback is executed' : 'promise resolves') +\n ` within ${timeoutInMilliseconds.toString()} milliseconds`\n finalPromise = wrapPromiseWithTimeout(\n finalPromise,\n timeoutInMilliseconds,\n timeoutMessage\n )\n }\n\n let error, result\n try {\n result = await finalPromise\n } catch (e) {\n if (e instanceof Error) {\n error = e\n } else if (doesHaveValue(e)) {\n error = util.format(e)\n } else {\n error = new Error('Promise rejected without a reason')\n }\n }\n\n UncaughtExceptionManager.unregisterHandler(exceptionHandler)\n\n return { error, result }\n },\n}\n\nexport default UserCodeRunner\n"]}
@@ -1,19 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.valueOrDefault = exports.doesNotHaveValue = exports.doesHaveValue = void 0;
3
+ exports.doesHaveValue = doesHaveValue;
4
+ exports.doesNotHaveValue = doesNotHaveValue;
5
+ exports.valueOrDefault = valueOrDefault;
4
6
  function doesHaveValue(value) {
5
7
  return !doesNotHaveValue(value);
6
8
  }
7
- exports.doesHaveValue = doesHaveValue;
8
9
  function doesNotHaveValue(value) {
9
10
  return value === null || value === undefined;
10
11
  }
11
- exports.doesNotHaveValue = doesNotHaveValue;
12
12
  function valueOrDefault(value, defaultValue) {
13
13
  if (doesHaveValue(value)) {
14
14
  return value;
15
15
  }
16
16
  return defaultValue;
17
17
  }
18
- exports.valueOrDefault = valueOrDefault;
19
18
  //# sourceMappingURL=value_checker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"value_checker.js","sourceRoot":"","sources":["../src/value_checker.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAI,KAAQ;IACvC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAFD,sCAEC;AAED,SAAgB,gBAAgB,CAAI,KAAQ;IAC1C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC;AAFD,4CAEC;AAED,SAAgB,cAAc,CAAI,KAAQ,EAAE,YAAe;IACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AALD,wCAKC","sourcesContent":["export function doesHaveValue<T>(value: T): boolean {\n return !doesNotHaveValue(value)\n}\n\nexport function doesNotHaveValue<T>(value: T): boolean {\n return value === null || value === undefined\n}\n\nexport function valueOrDefault<T>(value: T, defaultValue: T): T {\n if (doesHaveValue(value)) {\n return value\n }\n return defaultValue\n}\n"]}
1
+ {"version":3,"file":"value_checker.js","sourceRoot":"","sources":["../src/value_checker.ts"],"names":[],"mappings":";;AAAA,sCAEC;AAED,4CAEC;AAED,wCAKC;AAbD,SAAgB,aAAa,CAAI,KAAQ;IACvC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAED,SAAgB,gBAAgB,CAAI,KAAQ;IAC1C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC;AAED,SAAgB,cAAc,CAAI,KAAQ,EAAE,YAAe;IACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC","sourcesContent":["export function doesHaveValue<T>(value: T): boolean {\n return !doesNotHaveValue(value)\n}\n\nexport function doesNotHaveValue<T>(value: T): boolean {\n return value === null || value === undefined\n}\n\nexport function valueOrDefault<T>(value: T, defaultValue: T): T {\n if (doesHaveValue(value)) {\n return value\n }\n return defaultValue\n}\n"]}
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "11.1.1";
1
+ export declare const version = "11.3.0";
package/lib/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = '11.1.1';
5
+ exports.version = '11.3.0';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,QAAQ,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '11.1.1'\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,QAAQ,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '11.3.0'\n"]}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "gherkin",
9
9
  "tests"
10
10
  ],
11
- "version": "11.1.1",
11
+ "version": "11.3.0",
12
12
  "funding": "https://opencollective.com/cucumber",
13
13
  "homepage": "https://github.com/cucumber/cucumber-js",
14
14
  "author": "Julien Biezemans <jb@jbpros.com>",
@@ -217,19 +217,19 @@
217
217
  },
218
218
  "dependencies": {
219
219
  "@cucumber/ci-environment": "10.0.1",
220
- "@cucumber/cucumber-expressions": "17.1.0",
221
- "@cucumber/gherkin": "28.0.0",
220
+ "@cucumber/cucumber-expressions": "18.0.1",
221
+ "@cucumber/gherkin": "30.0.4",
222
222
  "@cucumber/gherkin-streams": "5.0.1",
223
- "@cucumber/gherkin-utils": "9.0.0",
224
- "@cucumber/html-formatter": "21.6.0",
225
- "@cucumber/junit-xml-formatter": "0.6.0",
223
+ "@cucumber/gherkin-utils": "9.2.0",
224
+ "@cucumber/html-formatter": "21.10.1",
225
+ "@cucumber/junit-xml-formatter": "0.7.1",
226
226
  "@cucumber/message-streams": "4.0.1",
227
- "@cucumber/messages": "24.1.0",
228
- "@cucumber/tag-expressions": "6.1.1",
227
+ "@cucumber/messages": "27.2.0",
228
+ "@cucumber/tag-expressions": "6.1.2",
229
229
  "assertion-error-formatter": "^3.0.0",
230
230
  "capital-case": "^1.0.4",
231
231
  "chalk": "^4.1.2",
232
- "cli-table3": "0.6.3",
232
+ "cli-table3": "0.6.5",
233
233
  "commander": "^10.0.0",
234
234
  "debug": "^4.3.4",
235
235
  "error-stack-parser": "^2.1.4",
@@ -242,77 +242,75 @@
242
242
  "knuth-shuffle-seeded": "^1.0.6",
243
243
  "lodash.merge": "^4.6.2",
244
244
  "lodash.mergewith": "^4.6.2",
245
- "luxon": "3.2.1",
245
+ "luxon": "3.6.1",
246
246
  "mime": "^3.0.0",
247
247
  "mkdirp": "^2.1.5",
248
248
  "mz": "^2.7.0",
249
249
  "progress": "^2.0.3",
250
- "read-pkg-up": "^7.0.1",
251
- "resolve-pkg": "^2.0.0",
252
- "semver": "7.5.3",
250
+ "read-package-up": "^11.0.0",
251
+ "semver": "7.7.1",
253
252
  "string-argv": "0.3.1",
254
253
  "supports-color": "^8.1.1",
255
- "tmp": "0.2.3",
256
- "type-fest": "^4.8.3",
254
+ "type-fest": "^4.41.0",
257
255
  "util-arity": "^1.1.0",
258
256
  "yaml": "^2.2.2",
259
- "yup": "1.2.0"
257
+ "yup": "1.6.1"
260
258
  },
261
259
  "devDependencies": {
262
- "@cucumber/compatibility-kit": "15.0.0",
263
- "@cucumber/query": "12.1.2",
264
- "@microsoft/api-extractor": "7.39.0",
265
- "@sinonjs/fake-timers": "10.0.2",
266
- "@types/chai": "4.3.4",
267
- "@types/debug": "4.1.7",
268
- "@types/dirty-chai": "2.0.2",
269
- "@types/express": "4.17.15",
260
+ "@cucumber/compatibility-kit": "17.0.1",
261
+ "@cucumber/query": "13.2.0",
262
+ "@microsoft/api-extractor": "7.52.7",
263
+ "@sinonjs/fake-timers": "14.0.0",
264
+ "@types/chai": "4.3.20",
265
+ "@types/debug": "4.1.12",
266
+ "@types/dirty-chai": "2.0.5",
267
+ "@types/express": "5.0.1",
270
268
  "@types/fs-extra": "9.0.13",
271
269
  "@types/glob": "8.1.0",
272
- "@types/has-ansi": "5.0.0",
273
- "@types/lodash.merge": "4.6.7",
274
- "@types/lodash.mergewith": "4.6.7",
275
- "@types/luxon": "3.2.0",
276
- "@types/mocha": "10.0.1",
277
- "@types/mustache": "4.2.2",
278
- "@types/mz": "2.7.4",
279
- "@types/node": "20.8.3",
280
- "@types/progress": "2.0.5",
281
- "@types/semver": "7.5.0",
282
- "@types/sinon-chai": "3.2.9",
283
- "@types/sinonjs__fake-timers": "8.1.2",
284
- "@types/stream-buffers": "3.0.4",
285
- "@types/tmp": "0.2.3",
286
- "@typescript-eslint/eslint-plugin": "6.7.4",
287
- "@typescript-eslint/parser": "6.7.4",
288
- "chai": "4.3.7",
289
- "chai-exclude": "2.1.0",
270
+ "@types/has-ansi": "5.0.2",
271
+ "@types/lodash.merge": "4.6.9",
272
+ "@types/lodash.mergewith": "4.6.9",
273
+ "@types/luxon": "3.6.2",
274
+ "@types/mocha": "10.0.10",
275
+ "@types/mustache": "4.2.5",
276
+ "@types/mz": "2.7.8",
277
+ "@types/node": "20.17.46",
278
+ "@types/progress": "2.0.7",
279
+ "@types/semver": "7.7.0",
280
+ "@types/sinon-chai": "3.2.12",
281
+ "@types/sinonjs__fake-timers": "8.1.5",
282
+ "@types/stream-buffers": "3.0.7",
283
+ "@types/tmp": "0.2.6",
284
+ "@typescript-eslint/eslint-plugin": "6.21.0",
285
+ "@typescript-eslint/parser": "6.21.0",
286
+ "chai": "4.5.0",
287
+ "chai-exclude": "2.1.1",
290
288
  "coffeescript": "2.7.0",
291
289
  "dependency-lint": "7.1.0",
292
290
  "dirty-chai": "2.0.1",
293
- "eslint": "8.51.0",
294
- "eslint-config-prettier": "9.0.0",
295
- "eslint-plugin-import": "2.28.1",
296
- "eslint-plugin-node": "11.1.0",
291
+ "eslint": "8.57.1",
292
+ "eslint-config-prettier": "10.1.5",
293
+ "eslint-plugin-import": "2.31.0",
294
+ "eslint-plugin-n": "17.17.0",
297
295
  "eslint-plugin-standard": "5.0.0",
298
296
  "eslint-plugin-unicorn": "^48.0.1",
299
297
  "express": "^4.21.0",
300
298
  "fs-extra": "10.1.0",
301
- "genversion": "3.1.1",
299
+ "genversion": "3.2.0",
302
300
  "mocha": "^11.0.1",
303
301
  "mustache": "4.2.0",
304
302
  "nyc": "15.1.0",
305
- "prettier": "3.0.3",
303
+ "prettier": "3.5.3",
306
304
  "reindent-template-literals": "1.1.0",
307
305
  "shx": "0.3.4",
308
- "sinon": "15.0.1",
306
+ "sinon": "15.2.0",
309
307
  "sinon-chai": "3.7.0",
310
- "stream-to-string": "1.2.0",
311
- "ts-node": "10.9.1",
312
- "tsd": "0.25.0",
313
- "typedoc": "^0.26.11",
314
- "typedoc-plugin-extras": "^3.1.0",
315
- "typescript": "^4.9.5"
308
+ "stream-to-string": "1.2.1",
309
+ "tmp": "0.2.3",
310
+ "ts-node": "10.9.2",
311
+ "tsd": "0.32.0",
312
+ "typedoc": "^0.28.0",
313
+ "typescript": "^5.8.3"
316
314
  },
317
315
  "overrides": {
318
316
  "ansi-regex": "^5.0.1"
@@ -1,12 +0,0 @@
1
- /// <reference types="node" />
2
- import { Writable } from 'node:stream';
3
- import { ILogger } from '../logger';
4
- export declare class ConsoleLogger implements ILogger {
5
- private stream;
6
- private debugEnabled;
7
- private console;
8
- constructor(stream: Writable, debugEnabled: boolean);
9
- debug(...content: any[]): void;
10
- error(...content: any[]): void;
11
- warn(...content: any[]): void;
12
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"console_logger.js","sourceRoot":"","sources":["../../src/api/console_logger.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AAItC,MAAa,aAAa;IAGd;IACA;IAHF,OAAO,CAAS;IACxB,YACU,MAAgB,EAChB,YAAqB;QADrB,WAAM,GAAN,MAAM,CAAU;QAChB,iBAAY,GAAZ,YAAY,CAAS;QAE7B,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,GAAG,OAAc;QACrB,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAA;SAC/B;IACH,CAAC;IAED,KAAK,CAAC,GAAG,OAAc;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,CAAC,GAAG,OAAc;QACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAA;IAC/B,CAAC;CACF;AAtBD,sCAsBC","sourcesContent":["import { Console } from 'node:console'\nimport { Writable } from 'node:stream'\nimport { ILogger } from '../logger'\n\nexport class ConsoleLogger implements ILogger {\n private console: Console\n constructor(\n private stream: Writable,\n private debugEnabled: boolean\n ) {\n this.console = new Console(this.stream)\n }\n\n debug(...content: any[]): void {\n if (this.debugEnabled) {\n this.console.debug(...content)\n }\n }\n\n error(...content: any[]): void {\n this.console.error(...content)\n }\n\n warn(...content: any[]): void {\n this.console.warn(...content)\n }\n}\n"]}
@@ -1,7 +0,0 @@
1
- import { ILogger } from '../logger';
2
- import { IRunEnvironment } from './types';
3
- type EnvironmentWithLogger = Required<IRunEnvironment> & {
4
- logger: ILogger;
5
- };
6
- export declare function mergeEnvironment(provided: IRunEnvironment): EnvironmentWithLogger;
7
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/api/environment.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAIhD,SAAgB,gBAAgB,CAC9B,QAAyB;IAEzB,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,EAAE,EACF;QACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,KAAK;KACb,EACD,QAAQ,CACT,CAAA;IACD,MAAM,MAAM,GAAG,IAAI,8BAAa,CAC9B,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,KAAK,CACtB,CAAA;IACD,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,eAAe,CAAC,CAAA;IACtD,OAAO;QACL,GAAG,eAAe;QAClB,MAAM,EAAE,MAAM;KACf,CAAA;AACH,CAAC;AAvBD,4CAuBC","sourcesContent":["import { ILogger } from '../logger'\nimport { IRunEnvironment } from './types'\nimport { ConsoleLogger } from './console_logger'\n\ntype EnvironmentWithLogger = Required<IRunEnvironment> & { logger: ILogger }\n\nexport function mergeEnvironment(\n provided: IRunEnvironment\n): EnvironmentWithLogger {\n const fullEnvironment = Object.assign(\n {},\n {\n cwd: process.cwd(),\n stdout: process.stdout,\n stderr: process.stderr,\n env: process.env,\n debug: false,\n },\n provided\n )\n const logger = new ConsoleLogger(\n fullEnvironment.stderr,\n fullEnvironment.debug\n )\n logger.debug('Resolved environment:', fullEnvironment)\n return {\n ...fullEnvironment,\n logger: logger,\n }\n}\n"]}
package/lib/logger.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export interface ILogger {
2
- debug: (...content: any[]) => void;
3
- error: (...content: any[]) => void;
4
- warn: (...content: any[]) => void;
5
- }
package/lib/logger.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"","sourcesContent":["export interface ILogger {\n debug: (...content: any[]) => void\n error: (...content: any[]) => void\n warn: (...content: any[]) => void\n}\n"]}