@cucumber/cucumber 12.9.0 → 13.0.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 (396) hide show
  1. package/README.md +8 -3
  2. package/bin/cucumber.js +2 -1
  3. package/lib/api/convert_configuration.d.ts +3 -4
  4. package/lib/api/convert_configuration.js +9 -11
  5. package/lib/api/emit_support_code_messages.d.ts +3 -3
  6. package/lib/api/emit_support_code_messages.js +13 -28
  7. package/lib/api/formatters.d.ts +7 -7
  8. package/lib/api/formatters.js +5 -2
  9. package/lib/api/gherkin.d.ts +3 -3
  10. package/lib/api/gherkin.js +2 -4
  11. package/lib/api/index.d.ts +2 -2
  12. package/lib/api/index.js +1 -1
  13. package/lib/api/load_configuration.d.ts +2 -2
  14. package/lib/api/load_configuration.js +4 -5
  15. package/lib/api/load_sources.d.ts +2 -2
  16. package/lib/api/load_sources.js +2 -2
  17. package/lib/api/load_support.d.ts +2 -2
  18. package/lib/api/load_support.js +3 -3
  19. package/lib/api/plugins.d.ts +2 -2
  20. package/lib/api/plugins.js +2 -2
  21. package/lib/api/run_cucumber.d.ts +3 -3
  22. package/lib/api/run_cucumber.js +17 -1
  23. package/lib/api/support.d.ts +3 -3
  24. package/lib/api/support.js +5 -5
  25. package/lib/api/test_helpers.d.ts +1 -1
  26. package/lib/api/test_helpers.js +8 -10
  27. package/lib/api/types.d.ts +9 -5
  28. package/lib/api/types.js +1 -1
  29. package/lib/assemble/assemble_test_cases.d.ts +4 -4
  30. package/lib/assemble/assemble_test_cases.js +2 -6
  31. package/lib/assemble/index.js +1 -1
  32. package/lib/assemble/types.d.ts +1 -1
  33. package/lib/assemble/types.js +1 -1
  34. package/lib/cli/i18n.js +5 -3
  35. package/lib/cli/index.d.ts +1 -1
  36. package/lib/cli/index.js +2 -2
  37. package/lib/cli/install_validator.js +4 -3
  38. package/lib/cli/run.js +7 -6
  39. package/lib/cli/validate_node_engine_version.js +2 -4
  40. package/lib/configuration/argv_parser.d.ts +1 -1
  41. package/lib/configuration/argv_parser.js +7 -7
  42. package/lib/configuration/check_schema.d.ts +1 -1
  43. package/lib/configuration/check_schema.js +17 -6
  44. package/lib/configuration/default_configuration.d.ts +1 -1
  45. package/lib/configuration/default_configuration.js +2 -1
  46. package/lib/configuration/from_file.d.ts +2 -2
  47. package/lib/configuration/from_file.js +6 -6
  48. package/lib/configuration/helpers.js +1 -1
  49. package/lib/configuration/index.js +1 -1
  50. package/lib/configuration/locate_file.js +3 -3
  51. package/lib/configuration/merge_configurations.d.ts +1 -1
  52. package/lib/configuration/merge_configurations.js +2 -10
  53. package/lib/configuration/parse_configuration.d.ts +2 -2
  54. package/lib/configuration/parse_configuration.js +3 -11
  55. package/lib/configuration/split_format_descriptor.d.ts +1 -2
  56. package/lib/configuration/split_format_descriptor.js +11 -71
  57. package/lib/configuration/types.d.ts +26 -3
  58. package/lib/configuration/types.js +1 -1
  59. package/lib/configuration/validate_configuration.d.ts +2 -2
  60. package/lib/configuration/validate_configuration.js +5 -3
  61. package/lib/environment/console_logger.d.ts +2 -2
  62. package/lib/environment/console_logger.js +1 -1
  63. package/lib/environment/index.js +1 -1
  64. package/lib/environment/make_environment.d.ts +1 -1
  65. package/lib/environment/make_environment.js +1 -1
  66. package/lib/environment/types.d.ts +1 -1
  67. package/lib/environment/types.js +1 -1
  68. package/lib/filter/filter_plugin.d.ts +1 -1
  69. package/lib/filter/filter_plugin.js +1 -1
  70. package/lib/filter/index.d.ts +1 -1
  71. package/lib/filter/index.js +2 -2
  72. package/lib/filter/order_pickles.d.ts +2 -2
  73. package/lib/filter/order_pickles.js +1 -1
  74. package/lib/filter/types.d.ts +1 -1
  75. package/lib/filter/types.js +1 -1
  76. package/lib/filter_stack_trace.d.ts +1 -1
  77. package/lib/filter_stack_trace.js +1 -1
  78. package/lib/formatter/builder.d.ts +7 -6
  79. package/lib/formatter/builder.js +6 -7
  80. package/lib/formatter/builtin/html.js +2 -2
  81. package/lib/formatter/builtin/index.d.ts +4 -4
  82. package/lib/formatter/builtin/index.js +14 -13
  83. package/lib/formatter/builtin/message.js +2 -2
  84. package/lib/formatter/builtin/pretty.d.ts +6 -0
  85. package/lib/formatter/builtin/pretty.js +19 -0
  86. package/lib/formatter/builtin/progress-bar.d.ts +6 -0
  87. package/lib/formatter/builtin/progress-bar.js +22 -0
  88. package/lib/formatter/builtin/progress.d.ts +6 -0
  89. package/lib/formatter/builtin/progress.js +18 -0
  90. package/lib/formatter/builtin/resolve_terminal_options.d.ts +3 -0
  91. package/lib/formatter/builtin/resolve_terminal_options.js +15 -0
  92. package/lib/formatter/builtin/summary.d.ts +6 -0
  93. package/lib/formatter/builtin/summary.js +15 -0
  94. package/lib/formatter/create_stream.d.ts +2 -2
  95. package/lib/formatter/create_stream.js +3 -5
  96. package/lib/formatter/find_class_or_plugin.js +1 -1
  97. package/lib/formatter/get_color_fns.d.ts +3 -3
  98. package/lib/formatter/get_color_fns.js +23 -52
  99. package/lib/formatter/helpers/duration_helpers.d.ts +1 -1
  100. package/lib/formatter/helpers/duration_helpers.js +1 -1
  101. package/lib/formatter/helpers/event_data_collector.d.ts +2 -2
  102. package/lib/formatter/helpers/event_data_collector.js +4 -6
  103. package/lib/formatter/helpers/formatters.d.ts +1 -1
  104. package/lib/formatter/helpers/formatters.js +1 -3
  105. package/lib/formatter/helpers/gherkin_document_parser.d.ts +1 -1
  106. package/lib/formatter/helpers/gherkin_document_parser.js +20 -18
  107. package/lib/formatter/helpers/index.d.ts +3 -3
  108. package/lib/formatter/helpers/index.js +8 -8
  109. package/lib/formatter/helpers/issue_helpers.d.ts +5 -5
  110. package/lib/formatter/helpers/issue_helpers.js +2 -2
  111. package/lib/formatter/helpers/keyword_type.js +2 -2
  112. package/lib/formatter/helpers/location_helpers.d.ts +1 -1
  113. package/lib/formatter/helpers/location_helpers.js +1 -1
  114. package/lib/formatter/helpers/pickle_parser.d.ts +2 -2
  115. package/lib/formatter/helpers/pickle_parser.js +8 -9
  116. package/lib/formatter/helpers/step_argument_formatter.d.ts +1 -1
  117. package/lib/formatter/helpers/step_argument_formatter.js +1 -1
  118. package/lib/formatter/helpers/summary_helpers.d.ts +2 -2
  119. package/lib/formatter/helpers/summary_helpers.js +8 -4
  120. package/lib/formatter/helpers/test_case_attempt_formatter.d.ts +4 -4
  121. package/lib/formatter/helpers/test_case_attempt_formatter.js +5 -5
  122. package/lib/formatter/helpers/test_case_attempt_parser.d.ts +4 -4
  123. package/lib/formatter/helpers/test_case_attempt_parser.js +4 -9
  124. package/lib/formatter/helpers/usage_helpers/index.d.ts +3 -3
  125. package/lib/formatter/helpers/usage_helpers/index.js +5 -6
  126. package/lib/formatter/import_code.js +2 -2
  127. package/lib/formatter/index.d.ts +25 -13
  128. package/lib/formatter/index.js +2 -2
  129. package/lib/formatter/json_formatter.d.ts +2 -2
  130. package/lib/formatter/json_formatter.js +9 -14
  131. package/lib/formatter/progress_formatter.d.ts +4 -1
  132. package/lib/formatter/progress_formatter.js +4 -1
  133. package/lib/formatter/rerun_formatter.d.ts +1 -1
  134. package/lib/formatter/rerun_formatter.js +2 -2
  135. package/lib/formatter/resolve_implementation.d.ts +1 -1
  136. package/lib/formatter/resolve_implementation.js +2 -2
  137. package/lib/formatter/snippets_formatter.d.ts +1 -1
  138. package/lib/formatter/snippets_formatter.js +2 -2
  139. package/lib/formatter/step_definition_snippet_builder/index.d.ts +4 -4
  140. package/lib/formatter/step_definition_snippet_builder/index.js +3 -3
  141. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts +1 -1
  142. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +3 -5
  143. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts +1 -1
  144. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js +1 -1
  145. package/lib/formatter/summary_formatter.d.ts +6 -3
  146. package/lib/formatter/summary_formatter.js +6 -3
  147. package/lib/formatter/usage_formatter.d.ts +1 -1
  148. package/lib/formatter/usage_formatter.js +4 -4
  149. package/lib/formatter/usage_json_formatter.d.ts +1 -1
  150. package/lib/formatter/usage_json_formatter.js +3 -3
  151. package/lib/index.d.ts +6 -11
  152. package/lib/index.js +13 -20
  153. package/lib/models/data_table.d.ts +1 -1
  154. package/lib/models/data_table.js +9 -5
  155. package/lib/models/definition.d.ts +4 -4
  156. package/lib/models/definition.js +1 -1
  157. package/lib/models/gherkin_step_keyword.js +1 -1
  158. package/lib/models/step_definition.d.ts +3 -3
  159. package/lib/models/step_definition.js +1 -1
  160. package/lib/models/test_case_hook_definition.d.ts +2 -2
  161. package/lib/models/test_case_hook_definition.js +1 -1
  162. package/lib/models/test_run_hook_definition.d.ts +1 -1
  163. package/lib/models/test_run_hook_definition.js +1 -1
  164. package/lib/models/test_step_hook_definition.d.ts +2 -2
  165. package/lib/models/test_step_hook_definition.js +1 -1
  166. package/lib/paths/index.js +1 -1
  167. package/lib/paths/paths.d.ts +3 -3
  168. package/lib/paths/paths.js +42 -18
  169. package/lib/paths/types.js +1 -1
  170. package/lib/pickle_filter.d.ts +1 -1
  171. package/lib/pickle_filter.js +3 -3
  172. package/lib/plugin/index.d.ts +1 -1
  173. package/lib/plugin/index.js +2 -2
  174. package/lib/plugin/plugin_manager.d.ts +2 -2
  175. package/lib/plugin/plugin_manager.js +1 -1
  176. package/lib/plugin/types.d.ts +59 -9
  177. package/lib/plugin/types.js +1 -1
  178. package/lib/publish/index.js +1 -1
  179. package/lib/publish/publish_plugin.d.ts +1 -1
  180. package/lib/publish/publish_plugin.js +14 -15
  181. package/lib/publish/types.js +1 -1
  182. package/lib/runtime/attachment_manager/index.d.ts +1 -1
  183. package/lib/runtime/attachment_manager/index.js +3 -6
  184. package/lib/runtime/coordinator.d.ts +13 -6
  185. package/lib/runtime/coordinator.js +26 -18
  186. package/lib/runtime/format_error.d.ts +1 -1
  187. package/lib/runtime/format_error.js +43 -15
  188. package/lib/runtime/helpers.d.ts +2 -2
  189. package/lib/runtime/helpers.js +2 -2
  190. package/lib/runtime/index.js +1 -1
  191. package/lib/runtime/make_runtime.d.ts +10 -9
  192. package/lib/runtime/make_runtime.js +4 -5
  193. package/lib/runtime/make_suggestion.d.ts +2 -2
  194. package/lib/runtime/make_suggestion.js +1 -1
  195. package/lib/runtime/parallel/adapter.d.ts +27 -39
  196. package/lib/runtime/parallel/adapter.js +124 -122
  197. package/lib/runtime/parallel/test_cases_phase.d.ts +19 -0
  198. package/lib/runtime/parallel/test_cases_phase.js +63 -0
  199. package/lib/runtime/parallel/test_run_hooks_phase.d.ts +11 -0
  200. package/lib/runtime/parallel/test_run_hooks_phase.js +33 -0
  201. package/lib/runtime/parallel/types.d.ts +38 -22
  202. package/lib/runtime/parallel/types.js +1 -1
  203. package/lib/runtime/parallel/worker.mjs +65 -0
  204. package/lib/runtime/scope/index.js +1 -1
  205. package/lib/runtime/scope/make_proxy.js +1 -1
  206. package/lib/runtime/scope/test_case_scope.d.ts +1 -1
  207. package/lib/runtime/scope/test_case_scope.js +1 -1
  208. package/lib/runtime/scope/test_run_scope.d.ts +1 -1
  209. package/lib/runtime/scope/test_run_scope.js +1 -1
  210. package/lib/runtime/serial/adapter.d.ts +15 -9
  211. package/lib/runtime/serial/adapter.js +21 -9
  212. package/lib/runtime/step_runner.d.ts +2 -2
  213. package/lib/runtime/step_runner.js +2 -2
  214. package/lib/runtime/stopwatch.d.ts +1 -1
  215. package/lib/runtime/stopwatch.js +1 -1
  216. package/lib/runtime/test_case_runner.d.ts +10 -9
  217. package/lib/runtime/test_case_runner.js +20 -12
  218. package/lib/runtime/types.d.ts +7 -3
  219. package/lib/runtime/types.js +1 -1
  220. package/lib/runtime/worker.d.ts +14 -13
  221. package/lib/runtime/worker.js +26 -44
  222. package/lib/sharding/index.js +1 -1
  223. package/lib/sharding/sharding_plugin.d.ts +1 -1
  224. package/lib/sharding/sharding_plugin.js +1 -1
  225. package/lib/step_arguments.d.ts +1 -1
  226. package/lib/step_arguments.js +1 -1
  227. package/lib/support_code_library_builder/build_parameter_type.d.ts +1 -1
  228. package/lib/support_code_library_builder/build_parameter_type.js +5 -3
  229. package/lib/support_code_library_builder/context.js +1 -1
  230. package/lib/support_code_library_builder/get_definition_line_and_uri.d.ts +1 -1
  231. package/lib/support_code_library_builder/get_definition_line_and_uri.js +1 -1
  232. package/lib/support_code_library_builder/index.d.ts +7 -7
  233. package/lib/support_code_library_builder/index.js +9 -9
  234. package/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts +1 -1
  235. package/lib/support_code_library_builder/parallel_can_assign_helpers.js +3 -4
  236. package/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts +2 -2
  237. package/lib/support_code_library_builder/sourced_parameter_type_registry.js +1 -1
  238. package/lib/support_code_library_builder/types.d.ts +8 -8
  239. package/lib/support_code_library_builder/types.js +1 -1
  240. package/lib/support_code_library_builder/validate_arguments.d.ts +1 -1
  241. package/lib/support_code_library_builder/validate_arguments.js +1 -1
  242. package/lib/support_code_library_builder/world.d.ts +2 -2
  243. package/lib/support_code_library_builder/world.js +2 -2
  244. package/lib/time.js +2 -2
  245. package/lib/try_require.js +3 -2
  246. package/lib/types/index.js +1 -1
  247. package/lib/uncaught_exception_manager.js +1 -1
  248. package/lib/user_code_runner.d.ts +1 -1
  249. package/lib/user_code_runner.js +3 -3
  250. package/lib/value_checker.js +1 -1
  251. package/lib/version.d.ts +1 -1
  252. package/lib/version.js +2 -2
  253. package/lib/wrapper.mjs +1 -5
  254. package/package.json +40 -63
  255. package/lib/api/convert_configuration.js.map +0 -1
  256. package/lib/api/emit_support_code_messages.js.map +0 -1
  257. package/lib/api/formatters.js.map +0 -1
  258. package/lib/api/gherkin.js.map +0 -1
  259. package/lib/api/index.js.map +0 -1
  260. package/lib/api/load_configuration.js.map +0 -1
  261. package/lib/api/load_sources.js.map +0 -1
  262. package/lib/api/load_support.js.map +0 -1
  263. package/lib/api/plugins.js.map +0 -1
  264. package/lib/api/run_cucumber.js.map +0 -1
  265. package/lib/api/support.js.map +0 -1
  266. package/lib/api/test_helpers.js.map +0 -1
  267. package/lib/api/types.js.map +0 -1
  268. package/lib/assemble/assemble_test_cases.js.map +0 -1
  269. package/lib/assemble/index.js.map +0 -1
  270. package/lib/assemble/types.js.map +0 -1
  271. package/lib/cli/i18n.js.map +0 -1
  272. package/lib/cli/index.js.map +0 -1
  273. package/lib/cli/install_validator.js.map +0 -1
  274. package/lib/cli/run.js.map +0 -1
  275. package/lib/cli/validate_node_engine_version.js.map +0 -1
  276. package/lib/configuration/argv_parser.js.map +0 -1
  277. package/lib/configuration/check_schema.js.map +0 -1
  278. package/lib/configuration/default_configuration.js.map +0 -1
  279. package/lib/configuration/from_file.js.map +0 -1
  280. package/lib/configuration/helpers.js.map +0 -1
  281. package/lib/configuration/index.js.map +0 -1
  282. package/lib/configuration/locate_file.js.map +0 -1
  283. package/lib/configuration/merge_configurations.js.map +0 -1
  284. package/lib/configuration/parse_configuration.js.map +0 -1
  285. package/lib/configuration/split_format_descriptor.js.map +0 -1
  286. package/lib/configuration/types.js.map +0 -1
  287. package/lib/configuration/validate_configuration.js.map +0 -1
  288. package/lib/environment/console_logger.js.map +0 -1
  289. package/lib/environment/index.js.map +0 -1
  290. package/lib/environment/make_environment.js.map +0 -1
  291. package/lib/environment/types.js.map +0 -1
  292. package/lib/filter/filter_plugin.js.map +0 -1
  293. package/lib/filter/index.js.map +0 -1
  294. package/lib/filter/order_pickles.js.map +0 -1
  295. package/lib/filter/types.js.map +0 -1
  296. package/lib/filter_stack_trace.js.map +0 -1
  297. package/lib/formatter/builder.js.map +0 -1
  298. package/lib/formatter/builtin/html.js.map +0 -1
  299. package/lib/formatter/builtin/index.js.map +0 -1
  300. package/lib/formatter/builtin/message.js.map +0 -1
  301. package/lib/formatter/create_stream.js.map +0 -1
  302. package/lib/formatter/find_class_or_plugin.js.map +0 -1
  303. package/lib/formatter/get_color_fns.js.map +0 -1
  304. package/lib/formatter/helpers/duration_helpers.js.map +0 -1
  305. package/lib/formatter/helpers/event_data_collector.js.map +0 -1
  306. package/lib/formatter/helpers/formatters.js.map +0 -1
  307. package/lib/formatter/helpers/gherkin_document_parser.js.map +0 -1
  308. package/lib/formatter/helpers/index.js.map +0 -1
  309. package/lib/formatter/helpers/issue_helpers.js.map +0 -1
  310. package/lib/formatter/helpers/keyword_type.js.map +0 -1
  311. package/lib/formatter/helpers/location_helpers.js.map +0 -1
  312. package/lib/formatter/helpers/pickle_parser.js.map +0 -1
  313. package/lib/formatter/helpers/step_argument_formatter.js.map +0 -1
  314. package/lib/formatter/helpers/summary_helpers.js.map +0 -1
  315. package/lib/formatter/helpers/test_case_attempt_formatter.js.map +0 -1
  316. package/lib/formatter/helpers/test_case_attempt_parser.js.map +0 -1
  317. package/lib/formatter/helpers/usage_helpers/index.js.map +0 -1
  318. package/lib/formatter/import_code.js.map +0 -1
  319. package/lib/formatter/index.js.map +0 -1
  320. package/lib/formatter/json_formatter.js.map +0 -1
  321. package/lib/formatter/progress_bar_formatter.d.ts +0 -18
  322. package/lib/formatter/progress_bar_formatter.js +0 -103
  323. package/lib/formatter/progress_bar_formatter.js.map +0 -1
  324. package/lib/formatter/progress_formatter.js.map +0 -1
  325. package/lib/formatter/rerun_formatter.js.map +0 -1
  326. package/lib/formatter/resolve_implementation.js.map +0 -1
  327. package/lib/formatter/snippets_formatter.js.map +0 -1
  328. package/lib/formatter/step_definition_snippet_builder/index.js.map +0 -1
  329. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +0 -1
  330. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +0 -1
  331. package/lib/formatter/summary_formatter.js.map +0 -1
  332. package/lib/formatter/usage_formatter.js.map +0 -1
  333. package/lib/formatter/usage_json_formatter.js.map +0 -1
  334. package/lib/index.js.map +0 -1
  335. package/lib/models/data_table.js.map +0 -1
  336. package/lib/models/definition.js.map +0 -1
  337. package/lib/models/gherkin_step_keyword.js.map +0 -1
  338. package/lib/models/step_definition.js.map +0 -1
  339. package/lib/models/test_case_hook_definition.js.map +0 -1
  340. package/lib/models/test_run_hook_definition.js.map +0 -1
  341. package/lib/models/test_step_hook_definition.js.map +0 -1
  342. package/lib/paths/index.js.map +0 -1
  343. package/lib/paths/paths.js.map +0 -1
  344. package/lib/paths/types.js.map +0 -1
  345. package/lib/pickle_filter.js.map +0 -1
  346. package/lib/plugin/index.js.map +0 -1
  347. package/lib/plugin/plugin_manager.js.map +0 -1
  348. package/lib/plugin/types.js.map +0 -1
  349. package/lib/publish/index.js.map +0 -1
  350. package/lib/publish/publish_plugin.js.map +0 -1
  351. package/lib/publish/types.js.map +0 -1
  352. package/lib/runtime/attachment_manager/index.js.map +0 -1
  353. package/lib/runtime/coordinator.js.map +0 -1
  354. package/lib/runtime/format_error.js.map +0 -1
  355. package/lib/runtime/helpers.js.map +0 -1
  356. package/lib/runtime/index.js.map +0 -1
  357. package/lib/runtime/make_runtime.js.map +0 -1
  358. package/lib/runtime/make_suggestion.js.map +0 -1
  359. package/lib/runtime/parallel/adapter.js.map +0 -1
  360. package/lib/runtime/parallel/run_worker.js +0 -25
  361. package/lib/runtime/parallel/run_worker.js.map +0 -1
  362. package/lib/runtime/parallel/types.js.map +0 -1
  363. package/lib/runtime/parallel/worker.d.ts +0 -25
  364. package/lib/runtime/parallel/worker.js +0 -83
  365. package/lib/runtime/parallel/worker.js.map +0 -1
  366. package/lib/runtime/scope/index.js.map +0 -1
  367. package/lib/runtime/scope/make_proxy.js.map +0 -1
  368. package/lib/runtime/scope/test_case_scope.js.map +0 -1
  369. package/lib/runtime/scope/test_run_scope.js.map +0 -1
  370. package/lib/runtime/serial/adapter.js.map +0 -1
  371. package/lib/runtime/step_runner.js.map +0 -1
  372. package/lib/runtime/stopwatch.js.map +0 -1
  373. package/lib/runtime/test_case_runner.js.map +0 -1
  374. package/lib/runtime/types.js.map +0 -1
  375. package/lib/runtime/worker.js.map +0 -1
  376. package/lib/sharding/index.js.map +0 -1
  377. package/lib/sharding/sharding_plugin.js.map +0 -1
  378. package/lib/step_arguments.js.map +0 -1
  379. package/lib/support_code_library_builder/build_parameter_type.js.map +0 -1
  380. package/lib/support_code_library_builder/context.js.map +0 -1
  381. package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +0 -1
  382. package/lib/support_code_library_builder/index.js.map +0 -1
  383. package/lib/support_code_library_builder/parallel_can_assign_helpers.js.map +0 -1
  384. package/lib/support_code_library_builder/sourced_parameter_type_registry.js.map +0 -1
  385. package/lib/support_code_library_builder/types.js.map +0 -1
  386. package/lib/support_code_library_builder/validate_arguments.js.map +0 -1
  387. package/lib/support_code_library_builder/world.js.map +0 -1
  388. package/lib/time.js.map +0 -1
  389. package/lib/try_require.js.map +0 -1
  390. package/lib/tsconfig.node.tsbuildinfo +0 -1
  391. package/lib/types/index.js.map +0 -1
  392. package/lib/uncaught_exception_manager.js.map +0 -1
  393. package/lib/user_code_runner.js.map +0 -1
  394. package/lib/value_checker.js.map +0 -1
  395. package/lib/version.js.map +0 -1
  396. /package/lib/runtime/parallel/{run_worker.d.ts → worker.d.mts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/parallel/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Envelope } from '@cucumber/messages'\nimport { RuntimeOptions } from '../index'\nimport { ISupportCodeCoordinates } from '../../api'\nimport { AssembledTestCase } from '../../assemble'\nimport { CanonicalSupportCodeIds } from '../../support_code_library_builder/types'\nimport { FormatOptions } from '../../formatter'\n\n// Messages from Coordinator to Worker\n\nexport type CoordinatorToWorkerCommand =\n | InitializeCommand\n | RunCommand\n | FinalizeCommand\n\nexport interface InitializeCommand {\n type: 'INITIALIZE'\n testRunStartedId: string\n supportCodeCoordinates: ISupportCodeCoordinates\n supportCodeIds: CanonicalSupportCodeIds\n options: RuntimeOptions\n snippetOptions: Pick<FormatOptions, 'snippetInterface' | 'snippetSyntax'>\n}\n\nexport interface RunCommand {\n type: 'RUN'\n assembledTestCase: AssembledTestCase\n failing: boolean\n}\n\nexport interface FinalizeCommand {\n type: 'FINALIZE'\n}\n\n// Messages from Worker to Coordinator\n\nexport type WorkerToCoordinatorEvent =\n | ReadyEvent\n | EnvelopeEvent\n | FinishedEvent\n\nexport interface ReadyEvent {\n type: 'READY'\n}\n\nexport interface EnvelopeEvent {\n type: 'ENVELOPE'\n envelope: Envelope\n}\n\nexport interface FinishedEvent {\n type: 'FINISHED'\n success: boolean\n}\n"]}
@@ -1,25 +0,0 @@
1
- import { WorkerToCoordinatorEvent, CoordinatorToWorkerCommand, InitializeCommand, RunCommand } from './types';
2
- type IExitFunction = (exitCode: number, error?: Error, message?: string) => void;
3
- type IMessageSender = (command: WorkerToCoordinatorEvent) => void;
4
- export declare class ChildProcessWorker {
5
- private readonly cwd;
6
- private readonly exit;
7
- private readonly id;
8
- private readonly eventBroadcaster;
9
- private readonly newId;
10
- private readonly sendMessage;
11
- private options;
12
- private supportCodeLibrary;
13
- private worker;
14
- constructor({ cwd, exit, id, sendMessage, }: {
15
- cwd: string;
16
- exit: IExitFunction;
17
- id: string;
18
- sendMessage: IMessageSender;
19
- });
20
- initialize({ testRunStartedId, supportCodeCoordinates, supportCodeIds, options, snippetOptions, }: InitializeCommand): Promise<void>;
21
- finalize(): Promise<void>;
22
- receiveMessage(command: CoordinatorToWorkerCommand): Promise<void>;
23
- runTestCase(command: RunCommand): Promise<void>;
24
- }
25
- export {};
@@ -1,83 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ChildProcessWorker = void 0;
7
- const node_events_1 = require("node:events");
8
- const node_url_1 = require("node:url");
9
- const node_module_1 = require("node:module");
10
- const messages_1 = require("@cucumber/messages");
11
- const support_code_library_builder_1 = __importDefault(require("../../support_code_library_builder"));
12
- const try_require_1 = __importDefault(require("../../try_require"));
13
- const worker_1 = require("../worker");
14
- const builder_1 = __importDefault(require("../../formatter/builder"));
15
- const { uuid } = messages_1.IdGenerator;
16
- class ChildProcessWorker {
17
- cwd;
18
- exit;
19
- id;
20
- eventBroadcaster;
21
- newId;
22
- sendMessage;
23
- options;
24
- supportCodeLibrary;
25
- worker;
26
- constructor({ cwd, exit, id, sendMessage, }) {
27
- this.id = id;
28
- this.newId = uuid();
29
- this.cwd = cwd;
30
- this.exit = exit;
31
- this.sendMessage = sendMessage;
32
- this.eventBroadcaster = new node_events_1.EventEmitter();
33
- this.eventBroadcaster.on('envelope', (envelope) => this.sendMessage({ type: 'ENVELOPE', envelope }));
34
- }
35
- async initialize({ testRunStartedId, supportCodeCoordinates, supportCodeIds, options, snippetOptions, }) {
36
- support_code_library_builder_1.default.reset(this.cwd, this.newId, supportCodeCoordinates);
37
- supportCodeCoordinates.requireModules.map((module) => (0, try_require_1.default)(module));
38
- supportCodeCoordinates.requirePaths.map((module) => (0, try_require_1.default)(module));
39
- for (const specifier of supportCodeCoordinates.loaders) {
40
- (0, node_module_1.register)(specifier, (0, node_url_1.pathToFileURL)('./'));
41
- }
42
- for (const path of supportCodeCoordinates.importPaths) {
43
- await import((0, node_url_1.pathToFileURL)(path).toString());
44
- }
45
- this.supportCodeLibrary = support_code_library_builder_1.default.finalize(supportCodeIds);
46
- this.options = options;
47
- const snippetBuilder = await builder_1.default.getStepDefinitionSnippetBuilder({
48
- cwd: this.cwd,
49
- snippetInterface: snippetOptions.snippetInterface,
50
- snippetSyntax: snippetOptions.snippetSyntax,
51
- supportCodeLibrary: this.supportCodeLibrary,
52
- });
53
- this.worker = new worker_1.Worker(testRunStartedId, this.id, this.eventBroadcaster, this.newId, this.options, this.supportCodeLibrary, snippetBuilder);
54
- await this.worker.runBeforeAllHooks();
55
- this.sendMessage({ type: 'READY' });
56
- }
57
- async finalize() {
58
- await this.worker.runAfterAllHooks();
59
- this.exit(0);
60
- }
61
- async receiveMessage(command) {
62
- switch (command.type) {
63
- case 'INITIALIZE':
64
- await this.initialize(command);
65
- break;
66
- case 'RUN':
67
- await this.runTestCase(command);
68
- break;
69
- case 'FINALIZE':
70
- await this.finalize();
71
- break;
72
- }
73
- }
74
- async runTestCase(command) {
75
- const success = await this.worker.runTestCase(command.assembledTestCase, command.failing);
76
- this.sendMessage({
77
- type: 'FINISHED',
78
- success,
79
- });
80
- }
81
- }
82
- exports.ChildProcessWorker = ChildProcessWorker;
83
- //# sourceMappingURL=worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/runtime/parallel/worker.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA0C;AAC1C,uCAAwC;AACxC,6CAAsC;AACtC,iDAA0D;AAC1D,sGAA0E;AAE1E,oEAA0C;AAC1C,sCAAkC;AAElC,sEAAsD;AAQtD,MAAM,EAAE,IAAI,EAAE,GAAG,sBAAW,CAAA;AAK5B,MAAa,kBAAkB;IACZ,GAAG,CAAQ;IACX,IAAI,CAAe;IAEnB,EAAE,CAAQ;IACV,gBAAgB,CAAc;IAC9B,KAAK,CAAmB;IACxB,WAAW,CAAgB;IACpC,OAAO,CAAgB;IACvB,kBAAkB,CAAoB;IACtC,MAAM,CAAQ;IAEtB,YAAY,EACV,GAAG,EACH,IAAI,EACJ,EAAE,EACF,WAAW,GAMZ;QACC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,CAAA;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,gBAAgB,GAAG,IAAI,0BAAY,EAAE,CAAA;QAC1C,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAAkB,EAAE,EAAE,CAC1D,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CACjD,CAAA;IACH,CAAC;IAED,KAAK,CAAC,U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OAAO,EACZ,IAAI,CAAC,kBAAkB,EACvB,cAAc,CACf,CAAA;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAA;QACrC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAA;QACpC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACd,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAmC;QACtD,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,YAAY;gBACf,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;gBAC9B,MAAK;YACP,KAAK,KAAK;gBACR,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;gBAC/B,MAAK;YACP,KAAK,UAAU;gBACb,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;gBACrB,MAAK;QACT,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAmB;QACnC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3C,OAAO,CAAC,iBAAiB,EACzB,OAAO,CAAC,OAAO,CAChB,CAAA;QACD,IAAI,CAAC,WAAW,CAAC;YACf,IAAI,EAAE,UAAU;YAChB,OAAO;SACR,CAAC,CAAA;IACJ,CAAC;CACF;AA5GD,gDA4GC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { pathToFileURL } from 'node:url'\nimport { register } from 'node:module'\nimport { Envelope, IdGenerator } from '@cucumber/messages'\nimport supportCodeLibraryBuilder from '../../support_code_library_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport tryRequire from '../../try_require'\nimport { Worker } from '../worker'\nimport { RuntimeOptions } from '../index'\nimport FormatterBuilder from '../../formatter/builder'\nimport {\n WorkerToCoordinatorEvent,\n CoordinatorToWorkerCommand,\n InitializeCommand,\n RunCommand,\n} from './types'\n\nconst { uuid } = IdGenerator\n\ntype IExitFunction = (exitCode: number, error?: Error, message?: string) => void\ntype IMessageSender = (command: WorkerToCoordinatorEvent) => void\n\nexport class ChildProcessWorker {\n private readonly cwd: string\n private readonly exit: IExitFunction\n\n private readonly id: string\n private readonly eventBroadcaster: EventEmitter\n private readonly newId: IdGenerator.NewId\n private readonly sendMessage: IMessageSender\n private options: RuntimeOptions\n private supportCodeLibrary: SupportCodeLibrary\n private worker: Worker\n\n constructor({\n cwd,\n exit,\n id,\n sendMessage,\n }: {\n cwd: string\n exit: IExitFunction\n id: string\n sendMessage: IMessageSender\n }) {\n this.id = id\n this.newId = uuid()\n this.cwd = cwd\n this.exit = exit\n this.sendMessage = sendMessage\n this.eventBroadcaster = new EventEmitter()\n this.eventBroadcaster.on('envelope', (envelope: Envelope) =>\n this.sendMessage({ type: 'ENVELOPE', envelope })\n )\n }\n\n async initialize({\n testRunStartedId,\n supportCodeCoordinates,\n supportCodeIds,\n options,\n snippetOptions,\n }: InitializeCommand): Promise<void> {\n supportCodeLibraryBuilder.reset(\n this.cwd,\n this.newId,\n supportCodeCoordinates\n )\n supportCodeCoordinates.requireModules.map((module) => tryRequire(module))\n supportCodeCoordinates.requirePaths.map((module) => tryRequire(module))\n for (const specifier of supportCodeCoordinates.loaders) {\n register(specifier, pathToFileURL('./'))\n }\n for (const path of supportCodeCoordinates.importPaths) {\n await import(pathToFileURL(path).toString())\n }\n this.supportCodeLibrary = supportCodeLibraryBuilder.finalize(supportCodeIds)\n\n this.options = options\n\n const snippetBuilder =\n await FormatterBuilder.getStepDefinitionSnippetBuilder({\n cwd: this.cwd,\n snippetInterface: snippetOptions.snippetInterface,\n snippetSyntax: snippetOptions.snippetSyntax,\n supportCodeLibrary: this.supportCodeLibrary,\n })\n\n this.worker = new Worker(\n testRunStartedId,\n this.id,\n this.eventBroadcaster,\n this.newId,\n this.options,\n this.supportCodeLibrary,\n snippetBuilder\n )\n await this.worker.runBeforeAllHooks()\n this.sendMessage({ type: 'READY' })\n }\n\n async finalize(): Promise<void> {\n await this.worker.runAfterAllHooks()\n this.exit(0)\n }\n\n async receiveMessage(command: CoordinatorToWorkerCommand): Promise<void> {\n switch (command.type) {\n case 'INITIALIZE':\n await this.initialize(command)\n break\n case 'RUN':\n await this.runTestCase(command)\n break\n case 'FINALIZE':\n await this.finalize()\n break\n }\n }\n\n async runTestCase(command: RunCommand): Promise<void> {\n const success = await this.worker.runTestCase(\n command.assembledTestCase,\n command.failing\n )\n this.sendMessage({\n type: 'FINISHED',\n success,\n })\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/scope/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,mDAAgC","sourcesContent":["export * from './test_case_scope'\nexport * from './test_run_scope'\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"make_proxy.js","sourceRoot":"","sources":["../../../src/runtime/scope/make_proxy.ts"],"names":[],"mappings":";;AAAA,8BAuCC;AAvCD,SAAgB,SAAS,CAAI,QAAmB;IAC9C,OAAO,IAAI,KAAK,CACd,EAAE,EACF;QACE,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU;YACpC,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;QACjE,CAAC;QACD,cAAc,CAAC,CAAC,EAAE,QAAQ;YACxB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC1C,CAAC;QACD,GAAG,CAAC,CAAC,EAAE,QAAQ;YACb,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAA;QACtD,CAAC;QACD,wBAAwB,CAAC,CAAC,EAAE,QAAQ;YAClC,OAAO,OAAO,CAAC,wBAAwB,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC/D,CAAC;QACD,cAAc,CAAC,CAAC;YACd,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC3C,CAAC;QACD,GAAG,CAAC,CAAC,EAAE,GAAG;YACR,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAA;QACrC,CAAC;QACD,YAAY,CAAC,CAAC;YACZ,OAAO,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;QACzC,CAAC;QACD,OAAO,CAAC,CAAC;YACP,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;QACpC,CAAC;QACD,iBAAiB,CAAC,CAAC;YACjB,OAAO,OAAO,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC9C,CAAC;QACD,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK;YACpB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC7D,CAAC;QACD,cAAc,CAAC,CAAC,EAAE,KAAK;YACrB,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAA;QAClD,CAAC;KACF,CACG,CAAA;AACR,CAAC","sourcesContent":["export function makeProxy<T>(getThing: () => any): T {\n return new Proxy(\n {},\n {\n defineProperty(_, property, attributes) {\n return Reflect.defineProperty(getThing(), property, attributes)\n },\n deleteProperty(_, property) {\n return Reflect.get(getThing(), property)\n },\n get(_, property) {\n return Reflect.get(getThing(), property, getThing())\n },\n getOwnPropertyDescriptor(_, property) {\n return Reflect.getOwnPropertyDescriptor(getThing(), property)\n },\n getPrototypeOf(_) {\n return Reflect.getPrototypeOf(getThing())\n },\n has(_, key) {\n return Reflect.has(getThing(), key)\n },\n isExtensible(_) {\n return Reflect.isExtensible(getThing())\n },\n ownKeys(_) {\n return Reflect.ownKeys(getThing())\n },\n preventExtensions(_) {\n return Reflect.preventExtensions(getThing())\n },\n set(_, property, value) {\n return Reflect.set(getThing(), property, value, getThing())\n },\n setPrototypeOf(_, proto) {\n return Reflect.setPrototypeOf(getThing(), proto)\n },\n }\n ) as T\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"test_case_scope.js","sourceRoot":"","sources":["../../../src/runtime/scope/test_case_scope.ts"],"names":[],"mappings":";;;AAUA,gDAKC;AAfD,uDAAoD;AAEpD,6CAAwC;AAMxC,MAAM,aAAa,GAAG,IAAI,oCAAiB,EAAsB,CAAA;AAE1D,KAAK,UAAU,kBAAkB,CACtC,KAAyB,EACzB,QAA4B;IAE5B,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC3C,CAAC;AAED,SAAS,QAAQ;IACf,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAA;IACtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAC,KAA+B,CAAA;AAC9C,CAAC;AAED;;;;;;;;;GASG;AACU,QAAA,UAAU,GAAG,IAAA,sBAAS,EAAS,QAAQ,CAAC,CAAA","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\nimport { IWorld } from '../../support_code_library_builder/world'\nimport { makeProxy } from './make_proxy'\n\ninterface TestCaseScopeStore<ParametersType = any> {\n world: IWorld<ParametersType>\n}\n\nconst testCaseScope = new AsyncLocalStorage<TestCaseScopeStore>()\n\nexport async function runInTestCaseScope<ResponseType>(\n store: TestCaseScopeStore,\n callback: () => ResponseType\n) {\n return testCaseScope.run(store, callback)\n}\n\nfunction getWorld<ParametersType = any>(): IWorld<ParametersType> {\n const store = testCaseScope.getStore()\n if (!store) {\n throw new Error(\n 'Attempted to access `world` from incorrect scope; only applicable to steps and case-level hooks'\n )\n }\n return store.world as IWorld<ParametersType>\n}\n\n/**\n * A proxy to the World instance for the currently-executing test case\n *\n * @beta\n * @remarks\n * Useful for getting a handle on the World when using arrow functions and thus\n * being unable to rely on the value of `this`. Only callable from the body of a\n * step or a `Before`, `After`, `BeforeStep` or `AfterStep` hook (will throw\n * otherwise).\n */\nexport const worldProxy = makeProxy<IWorld>(getWorld)\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"test_run_scope.js","sourceRoot":"","sources":["../../../src/runtime/scope/test_run_scope.ts"],"names":[],"mappings":";;;AAUA,8CAKC;AAfD,uDAAoD;AAEpD,6CAAwC;AAMxC,MAAM,YAAY,GAAG,IAAI,oCAAiB,EAAqB,CAAA;AAExD,KAAK,UAAU,iBAAiB,CACrC,KAAwB,EACxB,QAA4B;IAE5B,OAAO,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC1C,CAAC;AAED,SAAS,UAAU;IACjB,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAA;IACrC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAC,OAAmC,CAAA;AAClD,CAAC;AAED;;;;;;;;GAQG;AACU,QAAA,YAAY,GAAG,IAAA,sBAAS,EAAW,UAAU,CAAC,CAAA","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\nimport { IContext } from '../../support_code_library_builder/context'\nimport { makeProxy } from './make_proxy'\n\ninterface TestRunScopeStore<ParametersType = any> {\n context: IContext<ParametersType>\n}\n\nconst testRunScope = new AsyncLocalStorage<TestRunScopeStore>()\n\nexport async function runInTestRunScope<ResponseType>(\n store: TestRunScopeStore,\n callback: () => ResponseType\n) {\n return testRunScope.run(store, callback)\n}\n\nfunction getContext<ParametersType = any>(): IContext<ParametersType> {\n const store = testRunScope.getStore()\n if (!store) {\n throw new Error(\n 'Attempted to access `context` from incorrect scope; only applicable to run-level hooks'\n )\n }\n return store.context as IContext<ParametersType>\n}\n\n/**\n * A proxy to the context for the currently-executing test run.\n *\n * @beta\n * @remarks\n * Useful for getting a handle on the context when using arrow functions and thus\n * being unable to rely on the value of `this`. Only callable from the body of a\n * `BeforeAll` or `AfterAll` hook (will throw otherwise).\n */\nexport const contextProxy = makeProxy<IContext>(getContext)\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/runtime/serial/adapter.ts"],"names":[],"mappings":";;;AAIA,sCAAkC;AAKlC,MAAa,gBAAgB;IACV,MAAM,CAAQ;IACvB,OAAO,GAAY,KAAK,CAAA;IAEhC,YACE,gBAAwB,EACxB,gBAA8B,EAC9B,KAAwB,EACxB,OAAuB,EACvB,kBAAsC,EACtC,cAA4C;QAE5C,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CACtB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,OAAO,EACP,kBAAkB,EAClB,cAAc,CACf,CAAA;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CACP,kBAAoD;QAEpD,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAA;QACrC,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;YACtC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;YACrB,CAAC;QACH,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAA;QACpC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAA;IACtB,CAAC;CACF;AApCD,4CAoCC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { IdGenerator } from '@cucumber/messages'\nimport { RuntimeAdapter } from '../types'\nimport { AssembledTestCase } from '../../assemble'\nimport { Worker } from '../worker'\nimport { RuntimeOptions } from '../index'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport StepDefinitionSnippetBuilder from '../../formatter/step_definition_snippet_builder'\n\nexport class InProcessAdapter implements RuntimeAdapter {\n private readonly worker: Worker\n private failing: boolean = false\n\n constructor(\n testRunStartedId: string,\n eventBroadcaster: EventEmitter,\n newId: IdGenerator.NewId,\n options: RuntimeOptions,\n supportCodeLibrary: SupportCodeLibrary,\n snippetBuilder: StepDefinitionSnippetBuilder\n ) {\n this.worker = new Worker(\n testRunStartedId,\n undefined,\n eventBroadcaster,\n newId,\n options,\n supportCodeLibrary,\n snippetBuilder\n )\n }\n\n async run(\n assembledTestCases: ReadonlyArray<AssembledTestCase>\n ): Promise<boolean> {\n await this.worker.runBeforeAllHooks()\n for (const item of assembledTestCases) {\n const success = await this.worker.runTestCase(item, this.failing)\n if (!success) {\n this.failing = true\n }\n }\n await this.worker.runAfterAllHooks()\n return !this.failing\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"step_runner.js","sourceRoot":"","sources":["../../src/runtime/step_runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,kBAsEC;AAjGD,6DAA8C;AAC9C,2EAAgD;AAGhD,oDAIyB;AACzB,mCAA4C;AAC5C,2CAAoC;AACpC,iDAA4C;AAgBrC,KAAK,UAAU,GAAG,CAAC,EACxB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,IAAI,EACJ,cAAc,EACd,KAAK,GACO;IACZ,MAAM,SAAS,GAAG,IAAA,kBAAM,GAAE,CAAC,KAAK,EAAE,CAAA;IAClC,IAAI,KAAU,EAAE,MAAW,EAAE,cAA0C,CAAA;IAEvE,IAAI,CAAC;QACH,MAAM,IAAA,0BAAkB,EAAC,EAAE,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CAAC;QAChC,MAAM,GAAG,QAAQ,CAAC,oBAAoB,CAAC,OAAO,CAAA;IAChD,CAAC;SAAM,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAA;IAC/C,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAA;IAC/C,CAAC;IAED,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,GAAG,IAAA,0BAAW,EAAC,KAAK,EAAE,iBAAiB,CAAC,CAAA;IACjD,CAAC;IAED,OAAO;QACL,MAAM,EAAE;YACN,QAAQ;YACR,MAAM;YACN,GAAG,OAAO;SACX;QACD,KAAK;KACN,CAAA;AACH,CAAC;AAED,kBAAe,EAAE,GAAG,EAAE,CAAA","sourcesContent":["import * as messages from '@cucumber/messages'\nimport UserCodeRunner from '../user_code_runner'\nimport { ITestCaseHookParameter } from '../support_code_library_builder/types'\nimport { IDefinition, IGetInvocationDataResponse } from '../models/definition'\nimport {\n doesHaveValue,\n doesNotHaveValue,\n valueOrDefault,\n} from '../value_checker'\nimport { runInTestCaseScope } from './scope'\nimport { create } from './stopwatch'\nimport { formatError } from './format_error'\n\nexport interface IRunOptions {\n defaultTimeout: number\n filterStackTraces: boolean\n hookParameter: ITestCaseHookParameter\n step: messages.PickleStep\n stepDefinition: IDefinition\n world: any\n}\n\nexport interface RunStepResult {\n result: messages.TestStepResult\n error?: any\n}\n\nexport async function run({\n defaultTimeout,\n filterStackTraces,\n hookParameter,\n step,\n stepDefinition,\n world,\n}: IRunOptions): Promise<RunStepResult> {\n const stopwatch = create().start()\n let error: any, result: any, invocationData: IGetInvocationDataResponse\n\n try {\n await runInTestCaseScope({ world }, async () => {\n invocationData = await stepDefinition.getInvocationParameters({\n hookParameter,\n step,\n world,\n })\n })\n } catch (err) {\n error = err\n }\n\n if (doesNotHaveValue(error)) {\n const timeoutInMilliseconds = valueOrDefault(\n stepDefinition.options.timeout,\n defaultTimeout\n )\n\n if (invocationData.validCodeLengths.includes(stepDefinition.code.length)) {\n const data = await runInTestCaseScope({ world }, async () =>\n UserCodeRunner.run({\n argsArray: invocationData.parameters,\n fn: stepDefinition.code,\n thisArg: world,\n timeoutInMilliseconds,\n })\n )\n error = data.error\n result = data.result\n } else {\n error = invocationData.getInvalidCodeLengthMessage()\n }\n }\n\n const duration = stopwatch.stop().duration()\n let status: messages.TestStepResultStatus\n let details = {}\n if (result === 'skipped') {\n status = messages.TestStepResultStatus.SKIPPED\n } else if (result === 'pending') {\n status = messages.TestStepResultStatus.PENDING\n } else if (doesHaveValue(error)) {\n status = messages.TestStepResultStatus.FAILED\n } else {\n status = messages.TestStepResultStatus.PASSED\n }\n\n if (doesHaveValue(error)) {\n details = formatError(error, filterStackTraces)\n }\n\n return {\n result: {\n duration,\n status,\n ...details,\n },\n error,\n }\n}\n\nexport default { run }\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"stopwatch.js","sourceRoot":"","sources":["../../src/runtime/stopwatch.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA6D;AAC7D,mDAA6B;AAY7B,MAAM,aAAa;IAGG;IAFZ,OAAO,CAAQ;IAEvB,YAAoB,OAAiB,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QAAzC,SAAI,GAAJ,IAAI,CAAqC;IAAG,CAAC;IAEjE,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,cAAO,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;QACxC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC3B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ;QACN,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,IAAI,CAAA;QAClB,CAAC;QACD,OAAO,yBAAc,CAAC,YAAY,CAChC,IAAI,CAAC,IAAI,EACT,yBAAc,CAAC,sBAAsB,CACnC,cAAO,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CACzC,CACF,CAAA;IACH,CAAC;CACF;AAEM,MAAM,MAAM,GAAG,CAAC,IAAe,EAAc,EAAE,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAA;AAAjE,QAAA,MAAM,UAA2D;AAEvE,MAAM,SAAS,GAAG,GAAG,EAAE,CAC5B,yBAAc,CAAC,iCAAiC,CAAC,cAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;AADzD,QAAA,SAAS,aACgD","sourcesContent":["import { Duration, TimeConversion } from '@cucumber/messages'\nimport methods from '../time'\n\n/**\n * A utility for timing test run operations and returning duration and\n * timestamp objects in messages-compatible formats\n */\nexport interface IStopwatch {\n start: () => IStopwatch\n stop: () => IStopwatch\n duration: () => Duration\n}\n\nclass StopwatchImpl implements IStopwatch {\n private started: number\n\n constructor(private base: Duration = { seconds: 0, nanos: 0 }) {}\n\n start(): IStopwatch {\n this.started = methods.performance.now()\n return this\n }\n\n stop(): IStopwatch {\n this.base = this.duration()\n this.started = undefined\n return this\n }\n\n duration(): Duration {\n if (typeof this.started !== 'number') {\n return this.base\n }\n return TimeConversion.addDurations(\n this.base,\n TimeConversion.millisecondsToDuration(\n methods.performance.now() - this.started\n )\n )\n }\n}\n\nexport const create = (base?: Duration): IStopwatch => new StopwatchImpl(base)\n\nexport const timestamp = () =>\n TimeConversion.millisecondsSinceEpochToTimestamp(methods.Date.now())\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"test_case_runner.js","sourceRoot":"","sources":["../../src/runtime/test_case_runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6DA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envelope,\n getWorstTestStepResult,\n IdGenerator,\n} from '@cucumber/messages'\nimport { JsonObject } from 'type-fest'\nimport {\n ITestCaseHookParameter,\n ITestStepHookParameter,\n SupportCodeLibrary,\n} from '../support_code_library_builder/types'\nimport TestCaseHookDefinition from '../models/test_case_hook_definition'\nimport TestStepHookDefinition from '../models/test_step_hook_definition'\nimport { IDefinition } from '../models/definition'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport StepDefinition from '../models/step_definition'\nimport { IWorldOptions } from '../support_code_library_builder/world'\nimport StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'\nimport { timestamp } from './stopwatch'\nimport StepRunner, { RunStepResult } from './step_runner'\nimport AttachmentManager from './attachment_manager'\nimport { getAmbiguousStepException } from './helpers'\nimport { makeSuggestion } from './make_suggestion'\n\nexport interface INewTestCaseRunnerOptions {\n workerId?: string\n eventBroadcaster: EventEmitter\n gherkinDocument: messages.GherkinDocument\n newId: IdGenerator.NewId\n pickle: messages.Pickle\n testCase: messages.TestCase\n retries: number\n skip: boolean\n filterStackTraces: boolean\n supportCodeLibrary: SupportCodeLibrary\n worldParameters: JsonObject\n snippetBuilder: StepDefinitionSnippetBuilder\n}\n\nexport default class TestCaseRunner {\n private readonly workerId: string | undefined\n private readonly attachmentManager: AttachmentManager\n private currentTestCaseStartedId: string\n private currentTestStepId: string\n private readonly eventBroadcaster: EventEmitter\n private readonly gherkinDocument: messages.GherkinDocument\n private readonly newId: IdGenerator.NewId\n private readonly pickle: messages.Pickle\n private readonly testCase: messages.TestCase\n private readonly maxAttempts: number\n private readonly skip: boolean\n private readonly filterStackTraces: boolean\n private readonly supportCodeLibrary: SupportCodeLibrary\n private readonly snippetBuilder: StepDefinitionSnippetBuilder\n private testStepResults: messages.TestStepResult[]\n private world: any\n private readonly worldParameters: JsonObject\n\n constructor({\n workerId,\n eventBroadcaster,\n gherkinDocument,\n newId,\n pickle,\n testCase,\n retries = 0,\n skip,\n filterStackTraces,\n supportCodeLibrary,\n worldParameters,\n snippetBuilder,\n }: INewTestCaseRunnerOptions) {\n this.workerId = workerId\n this.attachmentManager = new AttachmentManager(\n ({ data, media, fileName }) => {\n if (doesNotHaveValue(this.currentTestStepId)) {\n throw new Error(\n 'Cannot attach when a step/hook is not running. Ensure your step/hook waits for the attach to finish.'\n )\n }\n const attachment: messages.Envelope = {\n attachment: {\n body: data,\n contentEncoding: media.encoding,\n mediaType: media.contentType,\n fileName,\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId: this.currentTestStepId,\n timestamp: timestamp(),\n },\n }\n this.eventBroadcaster.emit('envelope', attachment)\n }\n )\n this.eventBroadcaster = eventBroadcaster\n this.gherkinDocument = gherkinDocument\n this.maxAttempts = 1 + (skip ? 0 : retries)\n this.newId = newId\n this.pickle = pickle\n this.testCase = testCase\n this.skip = skip\n this.filterStackTraces = filterStackTraces\n this.supportCodeLibrary = supportCodeLibrary\n this.worldParameters = worldParameters\n this.snippetBuilder = snippetBuilder\n this.resetTestProgressData()\n }\n\n resetTestProgressData(): void {\n this.world = new this.supportCodeLibrary.World({\n attach: this.attachmentManager.create.bind(this.attachmentManager),\n log: this.attachmentManager.log.bind(this.attachmentManager),\n link: this.attachmentManager.link.bind(this.attachmentManager),\n parameters: structuredClone(this.worldParameters),\n } satisfies IWorldOptions)\n this.testStepResults = []\n }\n\n getBeforeStepHookDefinitions(): TestStepHookDefinition[] {\n return this.supportCodeLibrary.beforeTestStepHookDefinitions.filter(\n (hookDefinition) => hookDefinition.appliesToTestCase(this.pickle)\n )\n }\n\n getAfterStepHookDefinitions(): TestStepHookDefinition[] {\n return this.supportCodeLibrary.afterTestStepHookDefinitions\n .slice(0)\n .reverse()\n .filter((hookDefinition) => hookDefinition.appliesToTestCase(this.pickle))\n }\n\n getWorstStepResult(): messages.TestStepResult {\n if (this.testStepResults.length === 0) {\n return {\n status: this.skip\n ? messages.TestStepResultStatus.SKIPPED\n : messages.TestStepResultStatus.PASSED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n }\n }\n return getWorstTestStepResult(this.testStepResults)\n }\n\n async invokeStep(\n step: messages.PickleStep,\n stepDefinition: IDefinition,\n hookParameter?: ITestCaseHookParameter\n ): Promise<RunStepResult> {\n return await StepRunner.run({\n defaultTimeout: this.supportCodeLibrary.defaultTimeout,\n filterStackTraces: this.filterStackTraces,\n hookParameter,\n step,\n stepDefinition,\n world: this.world,\n })\n }\n\n isSkippingSteps(): boolean {\n return (\n this.getWorstStepResult().status !== messages.TestStepResultStatus.PASSED\n )\n }\n\n shouldSkipHook(isBeforeHook: boolean): boolean {\n return this.skip || (this.isSkippingSteps() && isBeforeHook)\n }\n\n async aroundTestStep(\n testStepId: string,\n runStepFn: () => Promise<messages.TestStepResult>\n ): Promise<void> {\n const testStepStarted: messages.Envelope = {\n testStepStarted: {\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId,\n timestamp: timestamp(),\n },\n }\n this.eventBroadcaster.emit('envelope', testStepStarted)\n this.currentTestStepId = testStepId\n const testStepResult = await runStepFn()\n this.currentTestStepId = null\n this.testStepResults.push(testStepResult)\n const testStepFinished: messages.Envelope = {\n testStepFinished: {\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId,\n testStepResult,\n timestamp: timestamp(),\n },\n }\n this.eventBroadcaster.emit('envelope', testStepFinished)\n }\n\n async run(): Promise<messages.TestStepResultStatus> {\n for (let attempt = 0; attempt < this.maxAttempts; attempt++) {\n const moreAttemptsRemaining = attempt + 1 < this.maxAttempts\n\n const willBeRetried = await this.runAttempt(\n attempt,\n moreAttemptsRemaining\n )\n\n if (!willBeRetried) {\n break\n }\n this.resetTestProgressData()\n }\n return this.getWorstStepResult().status\n }\n\n async runAttempt(\n attempt: number,\n moreAttemptsRemaining: boolean\n ): Promise<boolean> {\n this.currentTestCaseStartedId = this.newId()\n const testCaseStarted: messages.Envelope = {\n testCaseStarted: {\n attempt,\n testCaseId: this.testCase.id,\n id: this.currentTestCaseStartedId,\n timestamp: timestamp(),\n },\n }\n if (this.workerId) {\n testCaseStarted.testCaseStarted.workerId = this.workerId\n }\n this.eventBroadcaster.emit('envelope', testCaseStarted)\n // used to determine whether a hook is a Before or After\n let didWeRunStepsYet = false\n let error = false\n for (const testStep of this.testCase.testSteps) {\n await this.aroundTestStep(testStep.id, async () => {\n if (doesHaveValue(testStep.hookId)) {\n const hookParameter: ITestCaseHookParameter = {\n gherkinDocument: this.gherkinDocument,\n pickle: this.pickle,\n testCaseStartedId: this.currentTestCaseStartedId,\n }\n if (didWeRunStepsYet) {\n hookParameter.result = this.getWorstStepResult()\n hookParameter.error = error\n hookParameter.willBeRetried =\n this.getWorstStepResult().status ===\n messages.TestStepResultStatus.FAILED && moreAttemptsRemaining\n }\n return await this.runHook(\n findHookDefinition(testStep.hookId, this.supportCodeLibrary),\n hookParameter,\n !didWeRunStepsYet\n )\n } else {\n const pickleStep = this.pickle.steps.find(\n (pickleStep) => pickleStep.id === testStep.pickleStepId\n )\n const testStepResult = await this.runStep(pickleStep, testStep)\n didWeRunStepsYet = true\n error = testStepResult.error\n return testStepResult.result\n }\n })\n }\n\n const willBeRetried =\n this.getWorstStepResult().status ===\n messages.TestStepResultStatus.FAILED && moreAttemptsRemaining\n const testCaseFinished: messages.Envelope = {\n testCaseFinished: {\n testCaseStartedId: this.currentTestCaseStartedId,\n timestamp: timestamp(),\n willBeRetried,\n },\n }\n this.eventBroadcaster.emit('envelope', testCaseFinished)\n\n return willBeRetried\n }\n\n async runHook(\n hookDefinition: TestCaseHookDefinition,\n hookParameter: ITestCaseHookParameter,\n isBeforeHook: boolean\n ): Promise<messages.TestStepResult> {\n if (this.shouldSkipHook(isBeforeHook)) {\n return {\n status: messages.TestStepResultStatus.SKIPPED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n }\n }\n const { result } = await this.invokeStep(\n null,\n hookDefinition,\n hookParameter\n )\n return result\n }\n\n async runStepHooks(\n stepHooks: TestStepHookDefinition[],\n pickleStep: messages.PickleStep,\n stepResult?: RunStepResult\n ): Promise<messages.TestStepResult[]> {\n const stepHooksResult = []\n const hookParameter: ITestStepHookParameter = {\n gherkinDocument: this.gherkinDocument,\n pickle: this.pickle,\n pickleStep,\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId: this.currentTestStepId,\n result: stepResult?.result,\n error: stepResult?.error,\n }\n for (const stepHookDefinition of stepHooks) {\n const { result } = await this.invokeStep(\n null,\n stepHookDefinition,\n hookParameter\n )\n stepHooksResult.push(result)\n }\n return stepHooksResult\n }\n\n async runStep(\n pickleStep: messages.PickleStep,\n testStep: messages.TestStep\n ): Promise<RunStepResult> {\n const stepDefinitions = testStep.stepDefinitionIds.map(\n (stepDefinitionId) => {\n return findStepDefinition(stepDefinitionId, this.supportCodeLibrary)\n }\n )\n if (stepDefinitions.length === 0) {\n this.eventBroadcaster.emit('envelope', {\n suggestion: makeSuggestion({\n newId: this.newId,\n snippetBuilder: this.snippetBuilder,\n pickleStep,\n }),\n } satisfies Envelope)\n return {\n result: {\n status: messages.TestStepResultStatus.UNDEFINED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n },\n }\n } else if (stepDefinitions.length > 1) {\n return {\n result: {\n message: getAmbiguousStepException(stepDefinitions),\n status: messages.TestStepResultStatus.AMBIGUOUS,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n },\n }\n } else if (this.isSkippingSteps()) {\n return {\n result: {\n status: messages.TestStepResultStatus.SKIPPED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n },\n }\n }\n\n let stepResult\n let error\n let stepResults = await this.runStepHooks(\n this.getBeforeStepHookDefinitions(),\n pickleStep\n )\n if (\n getWorstTestStepResult(stepResults).status !==\n messages.TestStepResultStatus.FAILED\n ) {\n stepResult = await this.invokeStep(pickleStep, stepDefinitions[0])\n stepResults.push(stepResult.result)\n error = stepResult.error\n }\n const afterStepHookResults = await this.runStepHooks(\n this.getAfterStepHookDefinitions(),\n pickleStep,\n stepResult\n )\n stepResults = stepResults.concat(afterStepHookResults)\n\n const finalStepResult = getWorstTestStepResult(stepResults)\n let finalDuration = messages.TimeConversion.millisecondsToDuration(0)\n for (const result of stepResults) {\n finalDuration = messages.TimeConversion.addDurations(\n finalDuration,\n result.duration\n )\n }\n finalStepResult.duration = finalDuration\n return {\n result: finalStepResult,\n error,\n }\n }\n}\n\nfunction findHookDefinition(\n id: string,\n supportCodeLibrary: SupportCodeLibrary\n): TestCaseHookDefinition {\n return [\n ...supportCodeLibrary.beforeTestCaseHookDefinitions,\n ...supportCodeLibrary.afterTestCaseHookDefinitions,\n ].find((definition) => definition.id === id)\n}\n\nfunction findStepDefinition(\n id: string,\n supportCodeLibrary: SupportCodeLibrary\n): StepDefinition {\n return supportCodeLibrary.stepDefinitions.find(\n (definition) => definition.id === id\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonObject } from 'type-fest'\nimport { AssembledTestCase } from '../assemble'\n\nexport interface RuntimeOptions {\n dryRun: boolean\n failFast: boolean\n filterStacktraces: boolean\n retry: number\n retryTagFilter: string\n strict: boolean\n worldParameters: JsonObject\n}\n\nexport interface Runtime {\n run: () => Promise<boolean>\n}\n\nexport interface RuntimeAdapter {\n run(assembledTestCases: ReadonlyArray<AssembledTestCase>): Promise<boolean>\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/runtime/worker.ts"],"names":[],"mappings":";;;;;;AACA,iDAK2B;AAG3B,2EAAgD;AAChD,oDAAgE;AAEhE,kDAAqD;AAErD,uCAAgE;AAChE,0EAA+C;AAC/C,mCAA2C;AAC3C,iDAA4C;AAC5C,2CAA+C;AAQ/C,MAAa,MAAM;IAEE;IACA;IACA;IACA;IACA;IACA;IACA;IAPnB,YACmB,gBAAwB,EACxB,QAA4B,EAC5B,gBAA8B,EAC9B,KAAwB,EACxB,OAAuB,EACvB,kBAAsC,EACtC,cAA4C;QAN5C,qB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cAAc;SACpC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,CAAA;QAEzC,OAAO,CAAC,IAAA,4BAAkB,EAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,OAAO,GAAoB,EAAE,CAAA;QACnC,MAAM,QAAQ,GAAG;YACf,GAAG,IAAI,CAAC,kBAAkB,CAAC,2BAA2B;SACvD,CAAC,OAAO,EAAE,CAAA;QACX,KAAK,MAAM,cAAc,IAAI,QAAQ,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YACxD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACpB,IAAI,IAAA,6BAAa,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChC,MAAM,MAAM,CAAC,KAAK,CAAA;YACpB,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAvJD,wBAuJC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport {\n Envelope,\n IdGenerator,\n TestStepResult,\n TestStepResultStatus,\n} from '@cucumber/messages'\nimport { AssembledTestCase } from '../assemble'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport UserCodeRunner from '../user_code_runner'\nimport { doesHaveValue, valueOrDefault } from '../value_checker'\nimport TestRunHookDefinition from '../models/test_run_hook_definition'\nimport { formatLocation } from '../formatter/helpers'\nimport StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'\nimport { retriesForPickle, shouldCauseFailure } from './helpers'\nimport TestCaseRunner from './test_case_runner'\nimport { runInTestRunScope } from './scope'\nimport { formatError } from './format_error'\nimport { create, timestamp } from './stopwatch'\nimport { RuntimeOptions } from './types'\n\nexport interface RunHookResult {\n result: TestStepResult\n error?: any\n}\n\nexport class Worker {\n constructor(\n private readonly testRunStartedId: string,\n private readonly workerId: string | undefined,\n private readonly eventBroadcaster: EventEmitter,\n private readonly newId: IdGenerator.NewId,\n private readonly options: RuntimeOptions,\n private readonly supportCodeLibrary: SupportCodeLibrary,\n private readonly snippetBuilder: StepDefinitionSnippetBuilder\n ) {}\n\n private async runTestRunHook(\n hookDefinition: TestRunHookDefinition\n ): Promise<RunHookResult> {\n const testRunHookStartedId = this.newId()\n this.eventBroadcaster.emit('envelope', {\n testRunHookStarted: {\n testRunStartedId: this.testRunStartedId,\n workerId: this.workerId,\n id: testRunHookStartedId,\n hookId: hookDefinition.id,\n timestamp: timestamp(),\n },\n } satisfies Envelope)\n\n let result: TestStepResult\n let error: any\n if (this.options.dryRun) {\n result = {\n duration: {\n seconds: 0,\n nanos: 0,\n },\n status: TestStepResultStatus.SKIPPED,\n }\n } else {\n const stopwatch = create().start()\n const context = { parameters: this.options.worldParameters }\n const { error: rawError } = await runInTestRunScope({ context }, () =>\n UserCodeRunner.run({\n argsArray: [],\n fn: hookDefinition.code,\n thisArg: context,\n timeoutInMilliseconds: valueOrDefault(\n hookDefinition.options.timeout,\n this.supportCodeLibrary.defaultTimeout\n ),\n })\n )\n const duration = stopwatch.stop().duration()\n\n if (doesHaveValue(rawError)) {\n result = {\n duration,\n status: TestStepResultStatus.FAILED,\n ...formatError(rawError, this.options.filterStacktraces),\n }\n error = this.wrapTestRunHookError(\n 'a BeforeAll',\n formatLocation(hookDefinition),\n rawError\n )\n } else {\n result = {\n duration,\n status: TestStepResultStatus.PASSED,\n }\n }\n }\n\n this.eventBroadcaster.emit('envelope', {\n testRunHookFinished: {\n testRunHookStartedId,\n result,\n timestamp: timestamp(),\n },\n } satisfies Envelope)\n\n return {\n result,\n error,\n }\n }\n\n private wrapTestRunHookError(\n name: string,\n location: string,\n error: any\n ): any | undefined {\n if (!doesHaveValue(error)) {\n return undefined\n }\n let message = `${name} hook errored`\n if (this.workerId) {\n message += ` on worker ${this.workerId}`\n }\n message += `, process exiting: ${location}`\n return new Error(message, { cause: error })\n }\n\n async runBeforeAllHooks(): Promise<RunHookResult[]> {\n const results: RunHookResult[] = []\n for (const hookDefinition of this.supportCodeLibrary\n .beforeTestRunHookDefinitions) {\n const result = await this.runTestRunHook(hookDefinition)\n results.push(result)\n if (doesHaveValue(result.error)) {\n throw result.error\n }\n }\n return results\n }\n\n async runTestCase(\n { gherkinDocument, pickle, testCase }: AssembledTestCase,\n failing: boolean\n ): Promise<boolean> {\n const testCaseRunner = new TestCaseRunner({\n workerId: this.workerId,\n eventBroadcaster: this.eventBroadcaster,\n newId: this.newId,\n gherkinDocument,\n pickle,\n testCase,\n retries: retriesForPickle(pickle, this.options),\n skip: this.options.dryRun || (this.options.failFast && failing),\n filterStackTraces: this.options.filterStacktraces,\n supportCodeLibrary: this.supportCodeLibrary,\n worldParameters: this.options.worldParameters,\n snippetBuilder: this.snippetBuilder,\n })\n\n const status = await testCaseRunner.run()\n\n return !shouldCauseFailure(status, this.options)\n }\n\n async runAfterAllHooks(): Promise<RunHookResult[]> {\n const results: RunHookResult[] = []\n const reversed = [\n ...this.supportCodeLibrary.afterTestRunHookDefinitions,\n ].reverse()\n for (const hookDefinition of reversed) {\n const result = await this.runTestRunHook(hookDefinition)\n results.push(result)\n if (doesHaveValue(result.error)) {\n throw result.error\n }\n }\n return results\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sharding/index.ts"],"names":[],"mappings":";;AAAA,uDAAkD;AAElD,kBAAe,gCAAc,CAAA","sourcesContent":["import { shardingPlugin } from './sharding_plugin'\n\nexport default shardingPlugin\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharding_plugin.js","sourceRoot":"","sources":["../../src/sharding/sharding_plugin.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5C,SAAS,CAAC,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;YAC/C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACnB,OAAO,UAAU,CAAA;YACnB,CAAC;YAED,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC/D,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,GAAG,CAAC,CAAA;YAClD,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;YAE9C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,UAAU,KAAK,UAAU,CAAC,CAAA;QACnE,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { InternalPlugin } from '../plugin'\n\nexport const shardingPlugin: InternalPlugin = {\n type: 'plugin',\n coordinator: async ({ transform, options }) => {\n transform('pickles:filter', async (allPickles) => {\n if (!options.shard) {\n return allPickles\n }\n\n const [shardIndexStr, shardTotalStr] = options.shard.split('/')\n const shardIndex = parseInt(shardIndexStr, 10) - 1\n const shardTotal = parseInt(shardTotalStr, 10)\n\n return allPickles.filter((_, i) => i % shardTotal === shardIndex)\n })\n },\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"step_arguments.js","sourceRoot":"","sources":["../src/step_arguments.ts"],"names":[],"mappings":";;;;;AASA,8CAUC;AAnBD,0DAA4B;AAE5B,mDAA+C;AAO/C,SAAgB,iBAAiB,CAC/B,GAAgC,EAChC,OAA0C;IAE1C,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACzC,CAAC;SAAM,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACzC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,0BAA0B,mBAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AAChE,CAAC","sourcesContent":["import util from 'node:util'\nimport * as messages from '@cucumber/messages'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IPickleStepArgumentFunctionMap<T> {\n dataTable: (arg: messages.PickleTable) => T\n docString: (arg: messages.PickleDocString) => T\n}\n\nexport function parseStepArgument<T>(\n arg: messages.PickleStepArgument,\n mapping: IPickleStepArgumentFunctionMap<T>\n): T {\n if (doesHaveValue(arg.dataTable)) {\n return mapping.dataTable(arg.dataTable)\n } else if (doesHaveValue(arg.docString)) {\n return mapping.docString(arg.docString)\n }\n throw new Error(`Unknown step argument: ${util.inspect(arg)}`)\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"build_parameter_type.js","sourceRoot":"","sources":["../../src/support_code_library_builder/build_parameter_type.ts"],"names":[],"mappings":";;AAGA,gDAiBC;AApBD,yEAA8D;AAG9D,SAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,MAAM,EACN,WAAW,EACX,cAAc,EACd,oBAAoB,GACU;IAC9B,IAAI,OAAO,cAAc,KAAK,SAAS;QAAE,cAAc,GAAG,IAAI,CAAA;IAC9D,IAAI,OAAO,oBAAoB,KAAK,SAAS;QAAE,oBAAoB,GAAG,KAAK,CAAA;IAC3E,OAAO,IAAI,oCAAa,CACtB,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,cAAc,EACd,oBAAoB,CACrB,CAAA;AACH,CAAC","sourcesContent":["import { ParameterType } from '@cucumber/cucumber-expressions'\nimport { IParameterTypeDefinition } from './types'\n\nexport function buildParameterType({\n name,\n regexp,\n transformer,\n useForSnippets,\n preferForRegexpMatch,\n}: IParameterTypeDefinition<any>): ParameterType<any> {\n if (typeof useForSnippets !== 'boolean') useForSnippets = true\n if (typeof preferForRegexpMatch !== 'boolean') preferForRegexpMatch = false\n return new ParameterType(\n name,\n regexp,\n null,\n transformer,\n useForSnippets,\n preferForRegexpMatch\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/support_code_library_builder/context.ts"],"names":[],"mappings":"","sourcesContent":["export interface IContext<ParametersType = any> {\n readonly parameters: ParametersType\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_definition_line_and_uri.js","sourceRoot":"","sources":["../../src/support_code_library_builder/get_definition_line_and_uri.ts"],"names":[],"mappings":";;;;;AAOA,0DA0BC;AAjCD,0DAA4B;AAC5B,uCAAwC;AACxC,4EAAiE;AACjE,8DAA4D;AAC5D,oDAAgE;AAGhE,SAAgB,uBAAuB,CACrC,GAAW,EACX,UAAU,GAAG,yCAAoB;IAEjC,IAAI,IAAY,CAAA;IAChB,IAAI,GAAW,CAAA;IACf,MAAM,WAAW,GAAiB,4BAAgB,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,CAAA;IACrE,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CACjC,CAAC,KAAiB,EAAE,EAAE,CACpB,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC/D,CAAA;IACD,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,UAAU,CAAC,aAAa,EAAE,CAAA;QACjC,GAAG,GAAG,UAAU,CAAC,WAAW,EAAE,CAAA;QAC9B,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC9B,GAAG,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;YAC1B,CAAC;YACD,GAAG,GAAG,mBAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,IAAA,8BAAc,EAAC,IAAI,EAAE,CAAC,CAAC;QAC7B,GAAG,EAAE,IAAA,8BAAc,EAAC,GAAG,EAAE,SAAS,CAAC;KACpC,CAAA;AACH,CAAC","sourcesContent":["import path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport errorStackParser, { StackFrame } from 'error-stack-parser'\nimport { isFileNameInCucumber } from '../filter_stack_trace'\nimport { doesHaveValue, valueOrDefault } from '../value_checker'\nimport { ILineAndUri } from '../types'\n\nexport function getDefinitionLineAndUri(\n cwd: string,\n isExcluded = isFileNameInCucumber\n): ILineAndUri {\n let line: number\n let uri: string\n const stackframes: StackFrame[] = errorStackParser.parse(new Error())\n const stackframe = stackframes.find(\n (frame: StackFrame) =>\n frame.fileName !== __filename && !isExcluded(frame.fileName)\n )\n if (stackframe != null) {\n line = stackframe.getLineNumber()\n uri = stackframe.getFileName()\n if (doesHaveValue(uri)) {\n if (uri.startsWith('file://')) {\n uri = fileURLToPath(uri)\n }\n uri = path.relative(cwd, uri)\n }\n }\n\n return {\n line: valueOrDefault(line, 0),\n uri: valueOrDefault(uri, 'unknown'),\n }\n}\n"]}
@@ -1 +0,0 @@
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,kGAE2C;AAC3C,gFAAsD;AACtD,kDAAqD;AACrD,oDAAgD;AAEhD,8EAAoD;AAkBpD,oDAA2B;AAC3B,+EAAuE;AACvE,iEAA2D;AAC3D,uFAAgF;AAsChF,MAAa,yBAAyB;IACpB,OAAO,CAA2B;IAC1C,mBAAmB,CAAyB;IAC5C,kCAAkC,CAAiC;IACnE,iCAAiC,CAAgC;IACjE,kCAAkC,CAA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port * 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, {\n ITestRunHookDefinitionOptions,\n} 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 order: number\n keyword: GherkinStepKeyword\n pattern: string | RegExp\n uri: string\n}\n\ninterface ITestCaseHookDefinitionConfig {\n code: any\n line: number\n options: any\n order: number\n uri: string\n}\n\ninterface ITestStepHookDefinitionConfig {\n code: Function\n line: number\n options: any\n order: number\n uri: string\n}\n\ninterface ITestRunHookDefinitionConfig {\n code: Function\n line: number\n options: any\n order: number\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 definitionOrder: number\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(\n parameterType,\n source,\n this.definitionOrder++\n )\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 order: this.definitionOrder++,\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 order: this.definitionOrder++,\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 order: this.definitionOrder++,\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 order: this.definitionOrder++,\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, order, 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 order,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestStepHookDefinitions(\n configs: ITestStepHookDefinitionConfig[]\n ): TestStepHookDefinition[] {\n return configs.map(({ code, line, options, order, 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 order,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestRunHookDefinitions(\n configs: ITestRunHookDefinitionConfig[],\n canonicalIds?: string[]\n ): TestRunHookDefinition[] {\n return configs.map(({ code, line, options, order, uri }, index) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestRunHookDefinition({\n code: wrappedCode,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options: options as ITestRunHookDefinitionOptions,\n order,\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, order, 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 order,\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 canonicalIds?.afterTestRunHookDefinitionIds\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 canonicalIds?.beforeTestRunHookDefinitionIds\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.definitionOrder = 0\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 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"sourced_parameter_type_registry.js","sourceRoot":"","sources":["../../src/support_code_library_builder/sourced_parameter_type_registry.ts"],"names":[],"mappings":";;;AAAA,yEAGuC;AAGvC,MAAa,4BAA6B,SAAQ,4CAAqB;IAC7D,qBAAqB,GAGzB,IAAI,OAAO,EAAE,CAAA;IAEjB,0BAA0B,CACxB,aAAqC,EACrC,MAAmB,EACnB,KAAa;QAEb,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAA;QACvC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;IACrE,CAAC;IAED,YAAY,CAAC,aAAqC;QAChD,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACtD,CAAC;CACF;AAlBD,oEAkBC","sourcesContent":["import {\n ParameterType,\n ParameterTypeRegistry,\n} from '@cucumber/cucumber-expressions'\nimport { ILineAndUri } from '../types'\n\nexport class SourcedParameterTypeRegistry extends ParameterTypeRegistry {\n private parameterTypeToSource: WeakMap<\n ParameterType<unknown>,\n ILineAndUri & { order: number }\n > = new WeakMap()\n\n defineSourcedParameterType(\n parameterType: ParameterType<unknown>,\n source: ILineAndUri,\n order: number\n ) {\n this.defineParameterType(parameterType)\n this.parameterTypeToSource.set(parameterType, { ...source, order })\n }\n\n lookupSource(parameterType: ParameterType<unknown>) {\n return this.parameterTypeToSource.get(parameterType)\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/support_code_library_builder/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { JsonObject } from 'type-fest'\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 { IWorld } from './world'\nimport { SourcedParameterTypeRegistry } from './sourced_parameter_type_registry'\n\nexport type DefineStepPattern = string | RegExp\nexport type ParallelAssignmentValidator = (\n pickle: messages.Pickle,\n runningPickles: messages.Pickle[]\n) => boolean\nexport interface ITestCaseHookParameter {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n result?: messages.TestStepResult\n error?: any\n willBeRetried?: boolean\n testCaseStartedId: string\n}\n\nexport interface ITestStepHookParameter {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n pickleStep: messages.PickleStep\n result: messages.TestStepResult\n error?: any\n testCaseStartedId: string\n testStepId: string\n}\n\nexport type TestRunHookFunction = (this: {\n parameters: JsonObject\n}) => any | Promise<any>\n\nexport type TestCaseHookFunction<WorldType> = (\n this: WorldType,\n arg: ITestCaseHookParameter\n) => any | Promise<any>\n\nexport type TestStepHookFunction<WorldType> = (\n this: WorldType,\n arg: ITestStepHookParameter\n) => any | Promise<any>\n\nexport type TestStepFunction<WorldType> = (\n this: WorldType,\n ...args: any[]\n) => any | Promise<any>\n\nexport interface IDefineStepOptions {\n timeout?: number\n wrapperOptions?: any\n}\n\nexport interface IDefineTestCaseHookOptions {\n name?: string\n tags?: string\n timeout?: number\n}\n\nexport interface IDefineTestStepHookOptions {\n tags?: string\n timeout?: number\n}\n\nexport interface IDefineTestRunHookOptions {\n name?: string\n timeout?: number\n}\n\nexport interface IParameterTypeDefinition<T> {\n name: string\n regexp: readonly RegExp[] | readonly string[] | RegExp | string\n transformer?: (...match: string[]) => T\n useForSnippets?: boolean\n preferForRegexpMatch?: boolean\n}\n\nexport type IDefineStep = (<WorldType = IWorld>(\n pattern: DefineStepPattern,\n code: TestStepFunction<WorldType>\n) => void) &\n (<WorldType = IWorld>(\n pattern: DefineStepPattern,\n options: IDefineStepOptions,\n code: TestStepFunction<WorldType>\n ) => void)\n\nexport interface IDefineSupportCodeMethods {\n defineParameterType: (options: IParameterTypeDefinition<any>) => void\n defineStep: IDefineStep\n setDefaultTimeout: (milliseconds: number) => void\n setDefinitionFunctionWrapper: (fn: Function) => void\n setParallelCanAssign: (fn: ParallelAssignmentValidator) => void\n setWorldConstructor: (fn: any) => void\n After: (<WorldType = IWorld>(code: TestCaseHookFunction<WorldType>) => void) &\n (<WorldType = IWorld>(\n tags: string,\n code: TestCaseHookFunction<WorldType>\n ) => void) &\n (<WorldType = IWorld>(\n options: IDefineTestCaseHookOptions,\n code: TestCaseHookFunction<WorldType>\n ) => void)\n AfterStep: (<WorldType = IWorld>(\n code: TestStepHookFunction<WorldType>\n ) => void) &\n (<WorldType = IWorld>(\n tags: string,\n code: TestStepHookFunction<WorldType>\n ) => void) &\n (<WorldType = IWorld>(\n options: IDefineTestStepHookOptions,\n code: TestStepHookFunction<WorldType>\n ) => void)\n AfterAll: ((code: TestRunHookFunction) => void) &\n ((options: IDefineTestRunHookOptions, code: TestRunHookFunction) => void)\n Before: (<WorldType = IWorld>(\n code: TestCaseHookFunction<WorldType>\n ) => void) &\n (<WorldType = IWorld>(\n tags: string,\n code: TestCaseHookFunction<WorldType>\n ) => void) &\n (<WorldType = IWorld>(\n options: IDefineTestCaseHookOptions,\n code: TestCaseHookFunction<WorldType>\n ) => void)\n BeforeStep: (<WorldType = IWorld>(\n code: TestStepHookFunction<WorldType>\n ) => void) &\n (<WorldType = IWorld>(\n tags: string,\n code: TestStepHookFunction<WorldType>\n ) => void) &\n (<WorldType = IWorld>(\n options: IDefineTestStepHookOptions,\n code: TestStepHookFunction<WorldType>\n ) => void)\n BeforeAll: ((code: TestRunHookFunction) => void) &\n ((options: IDefineTestRunHookOptions, code: TestRunHookFunction) => void)\n Given: IDefineStep\n Then: IDefineStep\n When: IDefineStep\n}\n\nexport interface ISupportCodeCoordinates {\n requireModules: string[]\n requirePaths: string[]\n importPaths: string[]\n loaders: string[]\n}\n\nexport interface CanonicalSupportCodeIds {\n stepDefinitionIds: string[]\n beforeTestCaseHookDefinitionIds: string[]\n afterTestCaseHookDefinitionIds: string[]\n beforeTestRunHookDefinitionIds: string[]\n afterTestRunHookDefinitionIds: string[]\n}\n\nexport interface SupportCodeLibrary {\n readonly originalCoordinates: ISupportCodeCoordinates\n readonly afterTestCaseHookDefinitions: TestCaseHookDefinition[]\n readonly afterTestStepHookDefinitions: TestStepHookDefinition[]\n readonly afterTestRunHookDefinitions: TestRunHookDefinition[]\n readonly beforeTestCaseHookDefinitions: TestCaseHookDefinition[]\n readonly beforeTestStepHookDefinitions: TestStepHookDefinition[]\n readonly beforeTestRunHookDefinitions: TestRunHookDefinition[]\n readonly defaultTimeout: number\n readonly stepDefinitions: StepDefinition[]\n readonly undefinedParameterTypes: messages.UndefinedParameterType[]\n readonly parameterTypeRegistry: SourcedParameterTypeRegistry\n readonly World: any\n readonly parallelCanAssign: ParallelAssignmentValidator\n}\n"]}
@@ -1 +0,0 @@
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,OAAO,CAAC,OAAO,IAAI,IAAI,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAA;IACvE,CAAC;CACF,CAAA;AAED,MAAM,YAAY,GAAG;IACnB,YAAY,EAAE,UAAU;IACxB,SAAS,CAAC,EAAE,IAAI,EAAwB;QACtC,OAAO,OAAO,IAAI,KAAK,UAAU,CAAA;IACnC,CAAC;CACF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D;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"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"world.js","sourceRoot":"","sources":["../../src/support_code_library_builder/world.ts"],"names":[],"mappings":";;AAsBA,MAAqB,KAAK;IAGR,MAAM,CAAmB;IACzB,GAAG,CAAY;IACf,IAAI,CAAa;IACjB,UAAU,CAAgB;IAE1C,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,UAAU,GACoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAnBD,wBAmBC","sourcesContent":["import {\n ICreateAttachment,\n ICreateLink,\n ICreateLog,\n} from '../runtime/attachment_manager'\n\nexport interface IWorldOptions<ParametersType = any> {\n attach: ICreateAttachment\n log: ICreateLog\n link: ICreateLink\n parameters: ParametersType\n}\n\nexport interface IWorld<ParametersType = any> {\n readonly attach: ICreateAttachment\n readonly log: ICreateLog\n readonly link: ICreateLink\n readonly parameters: ParametersType\n\n [key: string]: any\n}\n\nexport default class World<ParametersType = any>\n implements IWorld<ParametersType>\n{\n public readonly attach: ICreateAttachment\n public readonly log: ICreateLog\n public readonly link: ICreateLink\n public readonly parameters: ParametersType\n\n constructor({\n attach,\n log,\n link,\n parameters,\n }: IWorldOptions<ParametersType>) {\n this.attach = attach\n this.log = log\n this.link = link\n this.parameters = parameters\n }\n}\n"]}
package/lib/time.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,8DAUC;AAED,wDAiBC;AAzDD,qDAA6C;AAC7C,6DAA8C;AAa9C,MAAM,OAAO,GAAqC;IAChD,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;IACzC,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IACvC,IAAI;IACJ,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;IACrC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;IACnC,WAAW,EAAX,6BAAW;CACZ,CAAA;AAED,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE,CAAC;IACxC,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAChD,OAAO,CAAC,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACtD,CAAC;AAED,SAAgB,yBAAyB,CACvC,gBAAoC,EACpC,iBAAqC;IAErC,MAAM,cAAc,GAClB,QAAQ,CAAC,cAAc,CAAC,iCAAiC,CACvD,iBAAiB,CAClB;QACD,QAAQ,CAAC,cAAc,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,CAAA;IAC7E,OAAO,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAA;AACvE,CAAC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,OAAmB,EACnB,qBAA6B,EAC7B,iBAAyB,EAAE;IAE3B,IAAI,SAAwC,CAAA;IAC5C,IAAI,cAAc,KAAK,EAAE,EAAE,CAAC;QAC1B,cAAc,GAAG,kCAAkC,qBAAqB,eAAe,CAAA;IACzF,CAAC;IACD,MAAM,cAAc,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxD,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,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 +0,0 @@
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,CAAC,4DAA4D;IACnF,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) // eslint-disable-line @typescript-eslint/no-require-imports\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 +0,0 @@
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/emit_support_code_messages.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/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/order_pickles.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/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/make_suggestion.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/sharding/index.ts","../src/sharding/sharding_plugin.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.9.3"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"","sourcesContent":["export interface ILineAndUri {\n line: number\n uri: string\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"uncaught_exception_manager.js","sourceRoot":"","sources":["../src/uncaught_exception_manager.ts"],"names":[],"mappings":";;AAEA,MAAM,wBAAwB,GAAG;IAC/B,eAAe,CAAC,OAAkC;QAChD,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAED,iBAAiB,CAAC,OAAkC;QAClD,OAAO,CAAC,cAAc,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,wBAAwB,CAAA","sourcesContent":["import UncaughtExceptionListener = NodeJS.UncaughtExceptionListener\n\nconst UncaughtExceptionManager = {\n registerHandler(handler: UncaughtExceptionListener): void {\n process.addListener('uncaughtException', handler)\n },\n\n unregisterHandler(handler: UncaughtExceptionListener): void {\n process.removeListener('uncaughtException', handler)\n },\n}\n\nexport default UncaughtExceptionMan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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 +0,0 @@
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"]}
@@ -1 +0,0 @@
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 = '12.9.0'\n"]}