@dev-blinq/cucumber-js 1.0.0-amdocs

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 (371) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +68 -0
  3. package/api/index.d.ts +6 -0
  4. package/bin/cucumber-js +3 -0
  5. package/bin/cucumber.js +3 -0
  6. package/bin/cucumber.ts +2 -0
  7. package/bin/download-install.js +167 -0
  8. package/lib/api/console_logger.d.ts +12 -0
  9. package/lib/api/console_logger.js +24 -0
  10. package/lib/api/console_logger.js.map +1 -0
  11. package/lib/api/convert_configuration.d.ts +4 -0
  12. package/lib/api/convert_configuration.js +66 -0
  13. package/lib/api/convert_configuration.js.map +1 -0
  14. package/lib/api/environment.d.ts +2 -0
  15. package/lib/api/environment.js +14 -0
  16. package/lib/api/environment.js.map +1 -0
  17. package/lib/api/formatters.d.ts +20 -0
  18. package/lib/api/formatters.js +61 -0
  19. package/lib/api/formatters.js.map +1 -0
  20. package/lib/api/gherkin.d.ts +21 -0
  21. package/lib/api/gherkin.js +146 -0
  22. package/lib/api/gherkin.js.map +1 -0
  23. package/lib/api/index.d.ts +12 -0
  24. package/lib/api/index.js +28 -0
  25. package/lib/api/index.js.map +1 -0
  26. package/lib/api/load_configuration.d.ts +9 -0
  27. package/lib/api/load_configuration.js +41 -0
  28. package/lib/api/load_configuration.js.map +1 -0
  29. package/lib/api/load_sources.d.ts +9 -0
  30. package/lib/api/load_sources.js +53 -0
  31. package/lib/api/load_sources.js.map +1 -0
  32. package/lib/api/load_support.d.ts +10 -0
  33. package/lib/api/load_support.js +30 -0
  34. package/lib/api/load_support.js.map +1 -0
  35. package/lib/api/paths.d.ts +8 -0
  36. package/lib/api/paths.js +102 -0
  37. package/lib/api/paths.js.map +1 -0
  38. package/lib/api/plugins.d.ts +4 -0
  39. package/lib/api/plugins.js +19 -0
  40. package/lib/api/plugins.js.map +1 -0
  41. package/lib/api/run_cucumber.d.ts +11 -0
  42. package/lib/api/run_cucumber.js +115 -0
  43. package/lib/api/run_cucumber.js.map +1 -0
  44. package/lib/api/runtime.d.ts +21 -0
  45. package/lib/api/runtime.js +36 -0
  46. package/lib/api/runtime.js.map +1 -0
  47. package/lib/api/support.d.ts +9 -0
  48. package/lib/api/support.js +26 -0
  49. package/lib/api/support.js.map +1 -0
  50. package/lib/api/test_helpers.d.ts +3 -0
  51. package/lib/api/test_helpers.js +36 -0
  52. package/lib/api/test_helpers.js.map +1 -0
  53. package/lib/api/types.d.ts +177 -0
  54. package/lib/api/types.js +3 -0
  55. package/lib/api/types.js.map +1 -0
  56. package/lib/api/wrapper.mjs +6 -0
  57. package/lib/cli/helpers.d.ts +39 -0
  58. package/lib/cli/helpers.js +224 -0
  59. package/lib/cli/helpers.js.map +1 -0
  60. package/lib/cli/i18n.d.ts +2 -0
  61. package/lib/cli/i18n.js +70 -0
  62. package/lib/cli/i18n.js.map +1 -0
  63. package/lib/cli/index.d.ts +21 -0
  64. package/lib/cli/index.js +64 -0
  65. package/lib/cli/index.js.map +1 -0
  66. package/lib/cli/install_validator.d.ts +1 -0
  67. package/lib/cli/install_validator.js +18 -0
  68. package/lib/cli/install_validator.js.map +1 -0
  69. package/lib/cli/run.d.ts +1 -0
  70. package/lib/cli/run.js +44 -0
  71. package/lib/cli/run.js.map +1 -0
  72. package/lib/cli/validate_node_engine_version.d.ts +10 -0
  73. package/lib/cli/validate_node_engine_version.js +24 -0
  74. package/lib/cli/validate_node_engine_version.js.map +1 -0
  75. package/lib/configuration/argv_parser.d.ts +20 -0
  76. package/lib/configuration/argv_parser.js +104 -0
  77. package/lib/configuration/argv_parser.js.map +1 -0
  78. package/lib/configuration/axios_client.d.ts +1 -0
  79. package/lib/configuration/axios_client.js +40 -0
  80. package/lib/configuration/axios_client.js.map +1 -0
  81. package/lib/configuration/check_schema.d.ts +2 -0
  82. package/lib/configuration/check_schema.js +60 -0
  83. package/lib/configuration/check_schema.js.map +1 -0
  84. package/lib/configuration/default_configuration.d.ts +2 -0
  85. package/lib/configuration/default_configuration.js +29 -0
  86. package/lib/configuration/default_configuration.js.map +1 -0
  87. package/lib/configuration/from_file.d.ts +3 -0
  88. package/lib/configuration/from_file.js +85 -0
  89. package/lib/configuration/from_file.js.map +1 -0
  90. package/lib/configuration/helpers.d.ts +1 -0
  91. package/lib/configuration/helpers.js +11 -0
  92. package/lib/configuration/helpers.js.map +1 -0
  93. package/lib/configuration/index.d.ts +7 -0
  94. package/lib/configuration/index.js +29 -0
  95. package/lib/configuration/index.js.map +1 -0
  96. package/lib/configuration/locate_file.d.ts +1 -0
  97. package/lib/configuration/locate_file.js +21 -0
  98. package/lib/configuration/locate_file.js.map +1 -0
  99. package/lib/configuration/merge_configurations.d.ts +2 -0
  100. package/lib/configuration/merge_configurations.js +48 -0
  101. package/lib/configuration/merge_configurations.js.map +1 -0
  102. package/lib/configuration/option_splitter.d.ts +3 -0
  103. package/lib/configuration/option_splitter.js +23 -0
  104. package/lib/configuration/option_splitter.js.map +1 -0
  105. package/lib/configuration/types.d.ts +30 -0
  106. package/lib/configuration/types.js +3 -0
  107. package/lib/configuration/types.js.map +1 -0
  108. package/lib/configuration/validate_configuration.d.ts +3 -0
  109. package/lib/configuration/validate_configuration.js +13 -0
  110. package/lib/configuration/validate_configuration.js.map +1 -0
  111. package/lib/filter_stack_trace.d.ts +3 -0
  112. package/lib/filter_stack_trace.js +38 -0
  113. package/lib/filter_stack_trace.js.map +1 -0
  114. package/lib/formatter/api.d.ts +2 -0
  115. package/lib/formatter/api.js +53 -0
  116. package/lib/formatter/api.js.map +1 -0
  117. package/lib/formatter/builder.d.ts +37 -0
  118. package/lib/formatter/builder.js +101 -0
  119. package/lib/formatter/builder.js.map +1 -0
  120. package/lib/formatter/bvt_analysis_formatter.d.ts +30 -0
  121. package/lib/formatter/bvt_analysis_formatter.js +334 -0
  122. package/lib/formatter/bvt_analysis_formatter.js.map +1 -0
  123. package/lib/formatter/feature_data_format.d.ts +23 -0
  124. package/lib/formatter/feature_data_format.js +182 -0
  125. package/lib/formatter/feature_data_format.js.map +1 -0
  126. package/lib/formatter/fixtures/typescript.d.ts +2 -0
  127. package/lib/formatter/fixtures/typescript.js +6 -0
  128. package/lib/formatter/fixtures/typescript.js.map +1 -0
  129. package/lib/formatter/get_color_fns.d.ts +15 -0
  130. package/lib/formatter/get_color_fns.js +56 -0
  131. package/lib/formatter/get_color_fns.js.map +1 -0
  132. package/lib/formatter/helpers/constants.d.ts +44 -0
  133. package/lib/formatter/helpers/constants.js +50 -0
  134. package/lib/formatter/helpers/constants.js.map +1 -0
  135. package/lib/formatter/helpers/duration_helpers.d.ts +2 -0
  136. package/lib/formatter/helpers/duration_helpers.js +9 -0
  137. package/lib/formatter/helpers/duration_helpers.js.map +1 -0
  138. package/lib/formatter/helpers/event_data_collector.d.ts +30 -0
  139. package/lib/formatter/helpers/event_data_collector.js +126 -0
  140. package/lib/formatter/helpers/event_data_collector.js.map +1 -0
  141. package/lib/formatter/helpers/formatters.d.ts +6 -0
  142. package/lib/formatter/helpers/formatters.js +45 -0
  143. package/lib/formatter/helpers/formatters.js.map +1 -0
  144. package/lib/formatter/helpers/gherkin_document_parser.d.ts +5 -0
  145. package/lib/formatter/helpers/gherkin_document_parser.js +66 -0
  146. package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -0
  147. package/lib/formatter/helpers/index.d.ts +10 -0
  148. package/lib/formatter/helpers/index.js +52 -0
  149. package/lib/formatter/helpers/index.js.map +1 -0
  150. package/lib/formatter/helpers/issue_helpers.d.ts +19 -0
  151. package/lib/formatter/helpers/issue_helpers.js +59 -0
  152. package/lib/formatter/helpers/issue_helpers.js.map +1 -0
  153. package/lib/formatter/helpers/keyword_type.d.ts +11 -0
  154. package/lib/formatter/helpers/keyword_type.js +32 -0
  155. package/lib/formatter/helpers/keyword_type.js.map +1 -0
  156. package/lib/formatter/helpers/location_helpers.d.ts +2 -0
  157. package/lib/formatter/helpers/location_helpers.js +17 -0
  158. package/lib/formatter/helpers/location_helpers.js.map +1 -0
  159. package/lib/formatter/helpers/pickle_parser.d.ts +17 -0
  160. package/lib/formatter/helpers/pickle_parser.js +28 -0
  161. package/lib/formatter/helpers/pickle_parser.js.map +1 -0
  162. package/lib/formatter/helpers/report_generator.d.ts +148 -0
  163. package/lib/formatter/helpers/report_generator.js +573 -0
  164. package/lib/formatter/helpers/report_generator.js.map +1 -0
  165. package/lib/formatter/helpers/step_argument_formatter.d.ts +2 -0
  166. package/lib/formatter/helpers/step_argument_formatter.js +48 -0
  167. package/lib/formatter/helpers/step_argument_formatter.js.map +1 -0
  168. package/lib/formatter/helpers/summary_helpers.d.ts +9 -0
  169. package/lib/formatter/helpers/summary_helpers.js +96 -0
  170. package/lib/formatter/helpers/summary_helpers.js.map +1 -0
  171. package/lib/formatter/helpers/test_case_attempt_formatter.d.ts +12 -0
  172. package/lib/formatter/helpers/test_case_attempt_formatter.js +114 -0
  173. package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -0
  174. package/lib/formatter/helpers/test_case_attempt_parser.d.ts +32 -0
  175. package/lib/formatter/helpers/test_case_attempt_parser.js +135 -0
  176. package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -0
  177. package/lib/formatter/helpers/upload_serivce.d.ts +26 -0
  178. package/lib/formatter/helpers/upload_serivce.js +237 -0
  179. package/lib/formatter/helpers/upload_serivce.js.map +1 -0
  180. package/lib/formatter/helpers/uploader.d.ts +12 -0
  181. package/lib/formatter/helpers/uploader.js +151 -0
  182. package/lib/formatter/helpers/uploader.js.map +1 -0
  183. package/lib/formatter/helpers/usage_helpers/index.d.ts +23 -0
  184. package/lib/formatter/helpers/usage_helpers/index.js +111 -0
  185. package/lib/formatter/helpers/usage_helpers/index.js.map +1 -0
  186. package/lib/formatter/html_formatter.d.ts +7 -0
  187. package/lib/formatter/html_formatter.js +30 -0
  188. package/lib/formatter/html_formatter.js.map +1 -0
  189. package/lib/formatter/index.d.ts +53 -0
  190. package/lib/formatter/index.js +21 -0
  191. package/lib/formatter/index.js.map +1 -0
  192. package/lib/formatter/json_formatter.d.ts +78 -0
  193. package/lib/formatter/json_formatter.js +230 -0
  194. package/lib/formatter/json_formatter.js.map +1 -0
  195. package/lib/formatter/junit_formatter.d.ts +17 -0
  196. package/lib/formatter/junit_formatter.js +181 -0
  197. package/lib/formatter/junit_formatter.js.map +1 -0
  198. package/lib/formatter/message_formatter.d.ts +5 -0
  199. package/lib/formatter/message_formatter.js +15 -0
  200. package/lib/formatter/message_formatter.js.map +1 -0
  201. package/lib/formatter/progress_bar_formatter.d.ts +18 -0
  202. package/lib/formatter/progress_bar_formatter.js +99 -0
  203. package/lib/formatter/progress_bar_formatter.js.map +1 -0
  204. package/lib/formatter/progress_formatter.d.ts +9 -0
  205. package/lib/formatter/progress_formatter.js +59 -0
  206. package/lib/formatter/progress_formatter.js.map +1 -0
  207. package/lib/formatter/rerun_formatter.d.ts +13 -0
  208. package/lib/formatter/rerun_formatter.js +80 -0
  209. package/lib/formatter/rerun_formatter.js.map +1 -0
  210. package/lib/formatter/snippets_formatter.d.ts +6 -0
  211. package/lib/formatter/snippets_formatter.js +61 -0
  212. package/lib/formatter/snippets_formatter.js.map +1 -0
  213. package/lib/formatter/step_definition_snippet_builder/index.d.ts +20 -0
  214. package/lib/formatter/step_definition_snippet_builder/index.js +46 -0
  215. package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -0
  216. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts +7 -0
  217. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +46 -0
  218. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -0
  219. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts +16 -0
  220. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js +11 -0
  221. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -0
  222. package/lib/formatter/summary_formatter.d.ts +14 -0
  223. package/lib/formatter/summary_formatter.js +68 -0
  224. package/lib/formatter/summary_formatter.js.map +1 -0
  225. package/lib/formatter/usage_formatter.d.ts +6 -0
  226. package/lib/formatter/usage_formatter.js +98 -0
  227. package/lib/formatter/usage_formatter.js.map +1 -0
  228. package/lib/formatter/usage_json_formatter.d.ts +7 -0
  229. package/lib/formatter/usage_json_formatter.js +34 -0
  230. package/lib/formatter/usage_json_formatter.js.map +1 -0
  231. package/lib/importer.js +13 -0
  232. package/lib/index.d.ts +58 -0
  233. package/lib/index.js +109 -0
  234. package/lib/index.js.map +1 -0
  235. package/lib/logger.d.ts +5 -0
  236. package/lib/logger.js +3 -0
  237. package/lib/logger.js.map +1 -0
  238. package/lib/models/data_table.d.ts +10 -0
  239. package/lib/models/data_table.js +46 -0
  240. package/lib/models/data_table.js.map +1 -0
  241. package/lib/models/definition.d.ts +55 -0
  242. package/lib/models/definition.js +22 -0
  243. package/lib/models/definition.js.map +1 -0
  244. package/lib/models/gherkin_step_keyword.d.ts +1 -0
  245. package/lib/models/gherkin_step_keyword.js +3 -0
  246. package/lib/models/gherkin_step_keyword.js.map +1 -0
  247. package/lib/models/pickle_order.d.ts +1 -0
  248. package/lib/models/pickle_order.js +3 -0
  249. package/lib/models/pickle_order.js.map +1 -0
  250. package/lib/models/step_definition.d.ts +11 -0
  251. package/lib/models/step_definition.js +37 -0
  252. package/lib/models/step_definition.js.map +1 -0
  253. package/lib/models/test_case_hook_definition.d.ts +10 -0
  254. package/lib/models/test_case_hook_definition.js +27 -0
  255. package/lib/models/test_case_hook_definition.js.map +1 -0
  256. package/lib/models/test_run_hook_definition.d.ts +3 -0
  257. package/lib/models/test_run_hook_definition.js +10 -0
  258. package/lib/models/test_run_hook_definition.js.map +1 -0
  259. package/lib/models/test_step_hook_definition.d.ts +9 -0
  260. package/lib/models/test_step_hook_definition.js +26 -0
  261. package/lib/models/test_step_hook_definition.js.map +1 -0
  262. package/lib/pickle_filter.d.ts +42 -0
  263. package/lib/pickle_filter.js +99 -0
  264. package/lib/pickle_filter.js.map +1 -0
  265. package/lib/plugin/index.d.ts +2 -0
  266. package/lib/plugin/index.js +19 -0
  267. package/lib/plugin/index.js.map +1 -0
  268. package/lib/plugin/plugin_manager.d.ts +13 -0
  269. package/lib/plugin/plugin_manager.js +36 -0
  270. package/lib/plugin/plugin_manager.js.map +1 -0
  271. package/lib/plugin/types.d.ts +14 -0
  272. package/lib/plugin/types.js +3 -0
  273. package/lib/plugin/types.js.map +1 -0
  274. package/lib/publish/http_stream.d.ts +30 -0
  275. package/lib/publish/http_stream.js +112 -0
  276. package/lib/publish/http_stream.js.map +1 -0
  277. package/lib/publish/index.d.ts +2 -0
  278. package/lib/publish/index.js +5 -0
  279. package/lib/publish/index.js.map +1 -0
  280. package/lib/publish/publish_plugin.d.ts +2 -0
  281. package/lib/publish/publish_plugin.js +48 -0
  282. package/lib/publish/publish_plugin.js.map +1 -0
  283. package/lib/runtime/assemble_test_cases.d.ts +13 -0
  284. package/lib/runtime/assemble_test_cases.js +88 -0
  285. package/lib/runtime/assemble_test_cases.js.map +1 -0
  286. package/lib/runtime/attachment_manager/index.d.ts +33 -0
  287. package/lib/runtime/attachment_manager/index.js +119 -0
  288. package/lib/runtime/attachment_manager/index.js.map +1 -0
  289. package/lib/runtime/format_error.d.ts +2 -0
  290. package/lib/runtime/format_error.js +36 -0
  291. package/lib/runtime/format_error.js.map +1 -0
  292. package/lib/runtime/helpers.d.ts +6 -0
  293. package/lib/runtime/helpers.js +101 -0
  294. package/lib/runtime/helpers.js.map +1 -0
  295. package/lib/runtime/index.d.ts +40 -0
  296. package/lib/runtime/index.js +76 -0
  297. package/lib/runtime/index.js.map +1 -0
  298. package/lib/runtime/parallel/command_types.d.ts +32 -0
  299. package/lib/runtime/parallel/command_types.js +3 -0
  300. package/lib/runtime/parallel/command_types.js.map +1 -0
  301. package/lib/runtime/parallel/coordinator.d.ts +72 -0
  302. package/lib/runtime/parallel/coordinator.js +222 -0
  303. package/lib/runtime/parallel/coordinator.js.map +1 -0
  304. package/lib/runtime/parallel/run_worker.d.ts +1 -0
  305. package/lib/runtime/parallel/run_worker.js +29 -0
  306. package/lib/runtime/parallel/run_worker.js.map +1 -0
  307. package/lib/runtime/parallel/worker.d.ts +26 -0
  308. package/lib/runtime/parallel/worker.js +87 -0
  309. package/lib/runtime/parallel/worker.js.map +1 -0
  310. package/lib/runtime/run_test_run_hooks.d.ts +3 -0
  311. package/lib/runtime/run_test_run_hooks.js +28 -0
  312. package/lib/runtime/run_test_run_hooks.js.map +1 -0
  313. package/lib/runtime/step_runner.d.ts +16 -0
  314. package/lib/runtime/step_runner.js +88 -0
  315. package/lib/runtime/step_runner.js.map +1 -0
  316. package/lib/runtime/stopwatch.d.ts +12 -0
  317. package/lib/runtime/stopwatch.js +34 -0
  318. package/lib/runtime/stopwatch.js.map +1 -0
  319. package/lib/runtime/test_case_runner.d.ts +55 -0
  320. package/lib/runtime/test_case_runner.js +277 -0
  321. package/lib/runtime/test_case_runner.js.map +1 -0
  322. package/lib/step_arguments.d.ts +6 -0
  323. package/lib/step_arguments.js +19 -0
  324. package/lib/step_arguments.js.map +1 -0
  325. package/lib/support_code_library_builder/build_parameter_type.d.ts +3 -0
  326. package/lib/support_code_library_builder/build_parameter_type.js +13 -0
  327. package/lib/support_code_library_builder/build_parameter_type.js.map +1 -0
  328. package/lib/support_code_library_builder/get_definition_line_and_uri.d.ts +3 -0
  329. package/lib/support_code_library_builder/get_definition_line_and_uri.js +29 -0
  330. package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +1 -0
  331. package/lib/support_code_library_builder/index.d.ts +74 -0
  332. package/lib/support_code_library_builder/index.js +304 -0
  333. package/lib/support_code_library_builder/index.js.map +1 -0
  334. package/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts +2 -0
  335. package/lib/support_code_library_builder/parallel_can_assign_helpers.js +16 -0
  336. package/lib/support_code_library_builder/parallel_can_assign_helpers.js.map +1 -0
  337. package/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts +7 -0
  338. package/lib/support_code_library_builder/sourced_parameter_type_registry.js +19 -0
  339. package/lib/support_code_library_builder/sourced_parameter_type_registry.js.map +1 -0
  340. package/lib/support_code_library_builder/types.d.ts +88 -0
  341. package/lib/support_code_library_builder/types.js +3 -0
  342. package/lib/support_code_library_builder/types.js.map +1 -0
  343. package/lib/support_code_library_builder/validate_arguments.d.ts +12 -0
  344. package/lib/support_code_library_builder/validate_arguments.js +73 -0
  345. package/lib/support_code_library_builder/validate_arguments.js.map +1 -0
  346. package/lib/support_code_library_builder/world.d.ts +18 -0
  347. package/lib/support_code_library_builder/world.js +11 -0
  348. package/lib/support_code_library_builder/world.js.map +1 -0
  349. package/lib/time.d.ts +18 -0
  350. package/lib/time.js +61 -0
  351. package/lib/time.js.map +1 -0
  352. package/lib/try_require.d.ts +7 -0
  353. package/lib/try_require.js +26 -0
  354. package/lib/try_require.js.map +1 -0
  355. package/lib/types/index.d.ts +4 -0
  356. package/lib/types/index.js +3 -0
  357. package/lib/types/index.js.map +1 -0
  358. package/lib/uncaught_exception_manager.d.ts +7 -0
  359. package/lib/uncaught_exception_manager.js +12 -0
  360. package/lib/uncaught_exception_manager.js.map +1 -0
  361. package/lib/user_code_runner.d.ts +14 -0
  362. package/lib/user_code_runner.js +82 -0
  363. package/lib/user_code_runner.js.map +1 -0
  364. package/lib/value_checker.d.ts +3 -0
  365. package/lib/value_checker.js +19 -0
  366. package/lib/value_checker.js.map +1 -0
  367. package/lib/version.d.ts +1 -0
  368. package/lib/version.js +6 -0
  369. package/lib/version.js.map +1 -0
  370. package/lib/wrapper.mjs +44 -0
  371. package/package.json +197 -0
@@ -0,0 +1,104 @@
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
+ const gherkin_1 = require("@cucumber/gherkin");
7
+ const commander_1 = require("commander");
8
+ const lodash_merge_1 = __importDefault(require("lodash.merge"));
9
+ const formatters_1 = __importDefault(require("../formatter/helpers/formatters"));
10
+ const version_1 = require("../version");
11
+ const ArgvParser = {
12
+ collect(val, memo = []) {
13
+ if (val) {
14
+ return [...memo, val];
15
+ }
16
+ return undefined;
17
+ },
18
+ mergeJson(option) {
19
+ return function (str, memo = {}) {
20
+ let val;
21
+ try {
22
+ val = JSON.parse(str);
23
+ }
24
+ catch (error) {
25
+ const e = error;
26
+ throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`);
27
+ }
28
+ if (typeof val !== 'object' || Array.isArray(val)) {
29
+ throw new Error(`${option} must be passed JSON of an object: ${str}`);
30
+ }
31
+ return (0, lodash_merge_1.default)(memo, val);
32
+ };
33
+ },
34
+ mergeTags(value, memo) {
35
+ return memo ? `${memo} and (${value})` : `(${value})`;
36
+ },
37
+ validateCountOption(value, optionName) {
38
+ const numericValue = parseInt(value);
39
+ if (isNaN(numericValue) || numericValue < 0) {
40
+ throw new Error(`${optionName} must be a non negative integer`);
41
+ }
42
+ return numericValue;
43
+ },
44
+ validateLanguage(value) {
45
+ if (!Object.keys(gherkin_1.dialects).includes(value)) {
46
+ throw new Error(`Unsupported ISO 639-1: ${value}`);
47
+ }
48
+ return value;
49
+ },
50
+ parse(argv) {
51
+ const program = new commander_1.Command('cucumber-js');
52
+ program
53
+ .storeOptionsAsProperties(false)
54
+ .usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')
55
+ .version(version_1.version, '-v, --version')
56
+ .option('-b, --backtrace', 'show full backtrace for errors')
57
+ .option('-c, --config <PATH>', 'specify configuration file')
58
+ .option('-d, --dry-run', 'invoke formatters without executing steps')
59
+ .option('--exit, --force-exit', 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit')
60
+ .option('--fail-fast', 'abort the run on first failure')
61
+ .option('-f, --format <TYPE[:PATH]>', 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\n' +
62
+ formatters_1.default.buildFormattersDocumentationString(), ArgvParser.collect)
63
+ .option('--format-options <JSON>', 'provide options for formatters (repeatable)', ArgvParser.mergeJson('--format-options'))
64
+ .option('--i18n-keywords <ISO 639-1>', 'list language keywords', ArgvParser.validateLanguage)
65
+ .option('--i18n-languages', 'list languages')
66
+ .option('-i, --import <GLOB|DIR|FILE>', 'import files before executing features (repeatable)', ArgvParser.collect)
67
+ .option('--language <ISO 639-1>', 'provide the default language for feature files')
68
+ .option('--name <REGEXP>', 'only execute the scenarios with name matching the expression (repeatable)', ArgvParser.collect)
69
+ .option('--order <TYPE[:SEED]>', 'run scenarios in the specified order. Type should be `defined` or `random`')
70
+ .option('-p, --profile <NAME>', 'specify the profile to use (repeatable)', ArgvParser.collect, [])
71
+ .option('--parallel <NUMBER_OF_WORKERS>', 'run in parallel with the given number of workers', (val) => ArgvParser.validateCountOption(val, '--parallel'))
72
+ .option('--publish', 'Publish a report to https://reports.cucumber.io')
73
+ .option('--publish-quiet', "Don't print information banner about publishing reports")
74
+ .option('-r, --require <GLOB|DIR|FILE>', 'require files before executing features (repeatable)', ArgvParser.collect)
75
+ .option('--require-module <NODE_MODULE>', 'require node modules before requiring files (repeatable)', ArgvParser.collect)
76
+ .option('--retry <NUMBER_OF_RETRIES>', 'specify the number of times to retry failing test cases (default: 0)', (val) => ArgvParser.validateCountOption(val, '--retry'))
77
+ .option('--retry-tag-filter <EXPRESSION>', `only retries the features or scenarios with tags matching the expression (repeatable).
78
+ This option requires '--retry' to be specified.`, ArgvParser.mergeTags)
79
+ .option('--strict', 'fail if there are pending steps')
80
+ .option('--no-strict', 'succeed even if there are pending steps')
81
+ .option('-t, --tags <EXPRESSION>', 'only execute the features or scenarios with tags matching the expression (repeatable)', ArgvParser.mergeTags)
82
+ .option('--world-parameters <JSON>', 'provide parameters that will be passed to the world constructor (repeatable)', ArgvParser.mergeJson('--world-parameters'))
83
+ .option('--run-name <NAME>', 'provide a name for the run')
84
+ .option('--bvt-rerun', 'rerun failed scenarios from the last run');
85
+ program.addHelpText('afterAll', 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md');
86
+ program.parse(argv);
87
+ const { config, i18nKeywords, i18nLanguages, profile, ...regularStuff } = program.opts();
88
+ const configuration = regularStuff;
89
+ if (program.args.length > 0) {
90
+ configuration.paths = program.args;
91
+ }
92
+ return {
93
+ options: {
94
+ config,
95
+ i18nKeywords,
96
+ i18nLanguages,
97
+ profile,
98
+ },
99
+ configuration,
100
+ };
101
+ },
102
+ };
103
+ exports.default = ArgvParser;
104
+ //# sourceMappingURL=argv_parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"argv_parser.js","sourceRoot":"","sources":["../../src/configuration/argv_parser.ts"],"names":[],"mappings":"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","sourcesContent":["import { dialects } from '@cucumber/gherkin'\nimport { Command } from 'commander'\nimport merge from 'lodash.merge'\nimport Formatters from '../formatter/helpers/formatters'\nimport { version } from '../version'\nimport { IConfiguration } from './types'\n\nexport interface IParsedArgvOptions {\n config?: string\n i18nKeywords?: string\n i18nLanguages?: boolean\n profile: string[]\n}\n\nexport interface IParsedArgv {\n options: IParsedArgvOptions\n configuration: Partial<IConfiguration>\n}\n\ntype IRawArgvOptions = Partial<Omit<IConfiguration, 'paths'>> &\n IParsedArgvOptions\n\nconst ArgvParser = {\n collect<T>(val: T, memo: T[] = []): T[] {\n if (val) {\n return [...memo, val]\n }\n return undefined\n },\n\n mergeJson(option: string): (str: string, memo?: object) => object {\n return function (str: string, memo: object = {}) {\n let val: object\n try {\n val = JSON.parse(str)\n } catch (error) {\n const e: Error = error\n throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`)\n }\n if (typeof val !== 'object' || Array.isArray(val)) {\n throw new Error(`${option} must be passed JSON of an object: ${str}`)\n }\n return merge(memo, val)\n }\n },\n\n mergeTags(value: string, memo?: string): string {\n return memo ? `${memo} and (${value})` : `(${value})`\n },\n\n validateCountOption(value: string, optionName: string): number {\n const numericValue = parseInt(value)\n if (isNaN(numericValue) || numericValue < 0) {\n throw new Error(`${optionName} must be a non negative integer`)\n }\n return numericValue\n },\n\n validateLanguage(value: string): string {\n if (!Object.keys(dialects).includes(value)) {\n throw new Error(`Unsupported ISO 639-1: ${value}`)\n }\n return value\n },\n\n parse(argv: string[]): IParsedArgv {\n const program = new Command('cucumber-js')\n\n program\n .storeOptionsAsProperties(false)\n .usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')\n .version(version, '-v, --version')\n .option('-b, --backtrace', 'show full backtrace for errors')\n .option('-c, --config <PATH>', 'specify configuration file')\n .option('-d, --dry-run', 'invoke formatters without executing steps')\n .option(\n '--exit, --force-exit',\n 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit'\n )\n .option('--fail-fast', 'abort the run on first failure')\n .option(\n '-f, --format <TYPE[:PATH]>',\n 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\\n' +\n Formatters.buildFormattersDocumentationString(),\n ArgvParser.collect\n )\n .option(\n '--format-options <JSON>',\n 'provide options for formatters (repeatable)',\n ArgvParser.mergeJson('--format-options')\n )\n .option(\n '--i18n-keywords <ISO 639-1>',\n 'list language keywords',\n ArgvParser.validateLanguage\n )\n .option('--i18n-languages', 'list languages')\n .option(\n '-i, --import <GLOB|DIR|FILE>',\n 'import files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--language <ISO 639-1>',\n 'provide the default language for feature files'\n )\n .option(\n '--name <REGEXP>',\n 'only execute the scenarios with name matching the expression (repeatable)',\n ArgvParser.collect\n )\n\n .option(\n '--order <TYPE[:SEED]>',\n 'run scenarios in the specified order. Type should be `defined` or `random`'\n )\n .option(\n '-p, --profile <NAME>',\n 'specify the profile to use (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--parallel <NUMBER_OF_WORKERS>',\n 'run in parallel with the given number of workers',\n (val) => ArgvParser.validateCountOption(val, '--parallel')\n )\n .option('--publish', 'Publish a report to https://reports.cucumber.io')\n .option(\n '--publish-quiet',\n \"Don't print information banner about publishing reports\"\n )\n .option(\n '-r, --require <GLOB|DIR|FILE>',\n 'require files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--require-module <NODE_MODULE>',\n 'require node modules before requiring files (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--retry <NUMBER_OF_RETRIES>',\n 'specify the number of times to retry failing test cases (default: 0)',\n (val) => ArgvParser.validateCountOption(val, '--retry')\n )\n .option(\n '--retry-tag-filter <EXPRESSION>',\n `only retries the features or scenarios with tags matching the expression (repeatable).\n This option requires '--retry' to be specified.`,\n ArgvParser.mergeTags\n )\n .option('--strict', 'fail if there are pending steps')\n .option('--no-strict', 'succeed even if there are pending steps')\n .option(\n '-t, --tags <EXPRESSION>',\n 'only execute the features or scenarios with tags matching the expression (repeatable)',\n ArgvParser.mergeTags\n )\n .option(\n '--world-parameters <JSON>',\n 'provide parameters that will be passed to the world constructor (repeatable)',\n ArgvParser.mergeJson('--world-parameters')\n )\n .option('--run-name <NAME>', 'provide a name for the run')\n .option('--bvt-rerun', 'rerun failed scenarios from the last run')\n\n program.addHelpText(\n 'afterAll',\n 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md'\n )\n\n program.parse(argv)\n const {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n ...regularStuff\n }: IRawArgvOptions = program.opts()\n const configuration: Partial<IConfiguration> = regularStuff\n if (program.args.length > 0) {\n configuration.paths = program.args\n }\n\n return {\n options: {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n },\n configuration,\n }\n },\n}\n\nexport default ArgvParser\n"]}
@@ -0,0 +1 @@
1
+ export declare const axiosClient: import("axios").AxiosInstance;
@@ -0,0 +1,40 @@
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.axiosClient = void 0;
7
+ /* eslint-disable no-console */
8
+ const axios_1 = __importDefault(require("axios"));
9
+ const tunnel_1 = __importDefault(require("tunnel"));
10
+ const getProxy = () => {
11
+ if (!process.env.PROXY) {
12
+ return null;
13
+ }
14
+ const proxy = process.env.PROXY;
15
+ const url = new URL(proxy);
16
+ const proxyObject = {
17
+ host: url.hostname,
18
+ port: Number(url.port),
19
+ };
20
+ const { username, password } = url;
21
+ if (username && password) {
22
+ proxyObject.proxyAuth = `${username}:${password}`;
23
+ }
24
+ return tunnel_1.default.httpsOverHttp({ proxy: proxyObject });
25
+ };
26
+ const createAxiosClient = () => {
27
+ try {
28
+ const agent = getProxy();
29
+ return axios_1.default.create({
30
+ httpsAgent: agent,
31
+ proxy: false,
32
+ });
33
+ }
34
+ catch (error) {
35
+ console.log(error.message);
36
+ throw new Error(`Error creating axios client ${error instanceof Error ? error.message : error.response.data}`);
37
+ }
38
+ };
39
+ exports.axiosClient = createAxiosClient();
40
+ //# sourceMappingURL=axios_client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axios_client.js","sourceRoot":"","sources":["../../src/configuration/axios_client.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA+B;AAC/B,kDAAyB;AACzB,oDAA6C;AAG7C,MAAM,QAAQ,GAAG,GAAiB,EAAE;IAClC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACtB,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,KAAK,GAAkB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA;IAC9C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;IAC1B,MAAM,WAAW,GAAiB;QAChC,IAAI,EAAE,GAAG,CAAC,QAAQ;QAClB,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;KACvB,CAAA;IAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;IAElC,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,WAAW,CAAC,SAAS,GAAG,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAA;KAClD;IACD,OAAO,gBAAM,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;AACrD,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC7B,IAAI;QACF,MAAM,KAAK,GAAmB,QAAQ,EAAE,CAAA;QACxC,OAAO,eAAK,CAAC,MAAM,CAAC;YAClB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;KACH;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1B,MAAM,IAAI,KAAK,CACb,+BACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAC1D,EAAE,CACH,CAAA;KACF;AACH,CAAC,CAAA;AAEY,QAAA,WAAW,GAAG,iBAAiB,EAAE,CAAA","sourcesContent":["/* eslint-disable no-console */\nimport axios from 'axios'\nimport tunnel, { ProxyOptions } from 'tunnel'\nimport { Agent } from 'http'\n\nconst getProxy = (): Agent | null => {\n if (!process.env.PROXY) {\n return null\n }\n\n const proxy: string | null = process.env.PROXY\n const url = new URL(proxy)\n const proxyObject: ProxyOptions = {\n host: url.hostname,\n port: Number(url.port),\n }\n\n const { username, password } = url\n\n if (username && password) {\n proxyObject.proxyAuth = `${username}:${password}`\n }\n return tunnel.httpsOverHttp({ proxy: proxyObject })\n}\n\nconst createAxiosClient = () => {\n try {\n const agent: string | Agent = getProxy()\n return axios.create({\n httpsAgent: agent,\n proxy: false,\n })\n } catch (error) {\n console.log(error.message)\n throw new Error(\n `Error creating axios client ${\n error instanceof Error ? error.message : error.response.data\n }`\n )\n }\n}\n\nexport const axiosClient = createAxiosClient()\n"]}
@@ -0,0 +1,2 @@
1
+ import { IConfiguration } from './types';
2
+ export declare function checkSchema(configuration: any): Partial<IConfiguration>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.checkSchema = void 0;
27
+ const yup = __importStar(require("yup"));
28
+ const gherkin_1 = require("@cucumber/gherkin");
29
+ const schema = yup.object().shape({
30
+ backtrace: yup.boolean(),
31
+ dryRun: yup.boolean(),
32
+ exit: yup.boolean(),
33
+ failFast: yup.boolean(),
34
+ format: yup.array().of(yup.string()),
35
+ formatOptions: yup.object(),
36
+ import: yup.array().of(yup.string()),
37
+ language: yup.string().oneOf(Object.keys(gherkin_1.dialects)),
38
+ name: yup.array().of(yup.string()),
39
+ order: yup.string().oneOf(['defined', 'random']),
40
+ paths: yup.array().of(yup.string()),
41
+ parallel: yup.number().integer().min(0),
42
+ publish: yup.boolean(),
43
+ publishQuiet: yup.boolean(),
44
+ require: yup.array().of(yup.string()),
45
+ requireModule: yup.array().of(yup.string()),
46
+ retry: yup.number().integer().min(0),
47
+ retryTagFilter: yup.string(),
48
+ strict: yup.boolean(),
49
+ tags: yup.string(),
50
+ worldParameters: yup.object(),
51
+ });
52
+ function checkSchema(configuration) {
53
+ return schema.validateSync(configuration, {
54
+ abortEarly: false,
55
+ strict: true,
56
+ stripUnknown: true,
57
+ });
58
+ }
59
+ exports.checkSchema = checkSchema;
60
+ //# sourceMappingURL=check_schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check_schema.js","sourceRoot":"","sources":["../../src/configuration/check_schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA0B;AAC1B,+CAA4C;AAG5C,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;IAChC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE;IACxB,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE;IACrB,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE;IACvB,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACpC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACpC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAC;IACnD,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IAClC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAChD,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;IACtB,YAAY,EAAE,GAAG,CAAC,OAAO,EAAE;IAC3B,OAAO,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACrC,aAAa,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IAC3C,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE;IAC5B,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE;IACrB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE;IAClB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE;CAC9B,CAAC,CAAA;AAEF,SAAgB,WAAW,CAAC,aAAkB;IAC5C,OAAO,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE;QACxC,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;KACnB,CAA4B,CAAA;AAC/B,CAAC;AAND,kCAMC","sourcesContent":["import * as yup from 'yup'\nimport { dialects } from '@cucumber/gherkin'\nimport { IConfiguration } from './types'\n\nconst schema = yup.object().shape({\n backtrace: yup.boolean(),\n dryRun: yup.boolean(),\n exit: yup.boolean(),\n failFast: yup.boolean(),\n format: yup.array().of(yup.string()),\n formatOptions: yup.object(),\n import: yup.array().of(yup.string()),\n language: yup.string().oneOf(Object.keys(dialects)),\n name: yup.array().of(yup.string()),\n order: yup.string().oneOf(['defined', 'random']),\n paths: yup.array().of(yup.string()),\n parallel: yup.number().integer().min(0),\n publish: yup.boolean(),\n publishQuiet: yup.boolean(),\n require: yup.array().of(yup.string()),\n requireModule: yup.array().of(yup.string()),\n retry: yup.number().integer().min(0),\n retryTagFilter: yup.string(),\n strict: yup.boolean(),\n tags: yup.string(),\n worldParameters: yup.object(),\n})\n\nexport function checkSchema(configuration: any): Partial<IConfiguration> {\n return schema.validateSync(configuration, {\n abortEarly: false,\n strict: true,\n stripUnknown: true,\n }) as Partial<IConfiguration>\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { IConfiguration } from './types';
2
+ export declare const DEFAULT_CONFIGURATION: IConfiguration;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_CONFIGURATION = void 0;
4
+ exports.DEFAULT_CONFIGURATION = {
5
+ backtrace: false,
6
+ dryRun: false,
7
+ forceExit: false,
8
+ failFast: false,
9
+ format: [],
10
+ formatOptions: {},
11
+ import: [],
12
+ language: 'en',
13
+ name: [],
14
+ order: 'defined',
15
+ paths: [],
16
+ parallel: 0,
17
+ publish: false,
18
+ publishQuiet: false,
19
+ require: [],
20
+ requireModule: [],
21
+ retry: 0,
22
+ retryTagFilter: '',
23
+ strict: true,
24
+ tags: '',
25
+ worldParameters: {},
26
+ runName: '',
27
+ bvtRerun: false,
28
+ };
29
+ //# sourceMappingURL=default_configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default_configuration.js","sourceRoot":"","sources":["../../src/configuration/default_configuration.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAmB;IACnD,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,EAAE;IACV,aAAa,EAAE,EAAE;IACjB,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC;IACR,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,EAAE;IACR,eAAe,EAAE,EAAE;IACnB,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,KAAK;CAChB,CAAA","sourcesContent":["import { IConfiguration } from './types'\n\nexport const DEFAULT_CONFIGURATION: IConfiguration = {\n backtrace: false,\n dryRun: false,\n forceExit: false,\n failFast: false,\n format: [],\n formatOptions: {},\n import: [],\n language: 'en',\n name: [],\n order: 'defined',\n paths: [],\n parallel: 0,\n publish: false,\n publishQuiet: false,\n require: [],\n requireModule: [],\n retry: 0,\n retryTagFilter: '',\n strict: true,\n tags: '',\n worldParameters: {},\n runName: '',\n bvtRerun: false,\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { IConfiguration } from './types';
2
+ import { ILogger } from '../logger';
3
+ export declare function fromFile(logger: ILogger, cwd: string, file: string, profiles?: string[]): Promise<Partial<IConfiguration>>;
@@ -0,0 +1,85 @@
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.fromFile = void 0;
7
+ const string_argv_1 = __importDefault(require("string-argv"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const yaml_1 = __importDefault(require("yaml"));
11
+ const util_1 = require("util");
12
+ const url_1 = require("url");
13
+ const merge_configurations_1 = require("./merge_configurations");
14
+ const argv_parser_1 = __importDefault(require("./argv_parser"));
15
+ const check_schema_1 = require("./check_schema");
16
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
17
+ const { importer } = require('../importer');
18
+ async function fromFile(logger, cwd, file, profiles = []) {
19
+ const definitions = await loadFile(cwd, file);
20
+ if (!definitions.default) {
21
+ logger.debug('No default profile defined in configuration file');
22
+ definitions.default = {};
23
+ }
24
+ if (profiles.length < 1) {
25
+ logger.debug('No profiles specified; using default profile');
26
+ profiles = ['default'];
27
+ }
28
+ const definedKeys = Object.keys(definitions);
29
+ profiles.forEach((profileKey) => {
30
+ if (!definedKeys.includes(profileKey)) {
31
+ throw new Error(`Requested profile "${profileKey}" doesn't exist`);
32
+ }
33
+ });
34
+ return (0, merge_configurations_1.mergeConfigurations)({}, ...profiles.map((profileKey) => extractConfiguration(logger, profileKey, definitions[profileKey])));
35
+ }
36
+ exports.fromFile = fromFile;
37
+ async function loadFile(cwd, file) {
38
+ const filePath = path_1.default.join(cwd, file);
39
+ const extension = path_1.default.extname(filePath);
40
+ let definitions;
41
+ switch (extension) {
42
+ case '.json':
43
+ definitions = JSON.parse(await (0, util_1.promisify)(fs_1.default.readFile)(filePath, { encoding: 'utf-8' }));
44
+ break;
45
+ case '.yaml':
46
+ case '.yml':
47
+ definitions = yaml_1.default.parse(await (0, util_1.promisify)(fs_1.default.readFile)(filePath, { encoding: 'utf-8' }));
48
+ break;
49
+ default:
50
+ try {
51
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
52
+ definitions = require(filePath);
53
+ }
54
+ catch (error) {
55
+ if (error.code === 'ERR_REQUIRE_ESM') {
56
+ definitions = await importer((0, url_1.pathToFileURL)(filePath));
57
+ }
58
+ else {
59
+ throw error;
60
+ }
61
+ }
62
+ }
63
+ if (typeof definitions !== 'object') {
64
+ throw new Error(`Configuration file ${filePath} does not export an object`);
65
+ }
66
+ return definitions;
67
+ }
68
+ function extractConfiguration(logger, name, definition) {
69
+ if (typeof definition === 'string') {
70
+ logger.debug(`Profile "${name}" value is a string; parsing as argv`);
71
+ const { configuration } = argv_parser_1.default.parse([
72
+ 'node',
73
+ 'cucumber-js',
74
+ ...(0, string_argv_1.default)(definition),
75
+ ]);
76
+ return configuration;
77
+ }
78
+ try {
79
+ return (0, check_schema_1.checkSchema)(definition);
80
+ }
81
+ catch (error) {
82
+ throw new Error(`Requested profile "${name}" failed schema validation: ${error.errors.join(' ')}`);
83
+ }
84
+ }
85
+ //# sourceMappingURL=from_file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from_file.js","sourceRoot":"","sources":["../../src/configuration/from_file.ts"],"names":[],"mappings":"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","sourcesContent":["import stringArgv from 'string-argv'\nimport fs from 'fs'\nimport path from 'path'\nimport YAML from 'yaml'\nimport { promisify } from 'util'\nimport { pathToFileURL } from 'url'\nimport { IConfiguration } from './types'\nimport { mergeConfigurations } from './merge_configurations'\nimport ArgvParser from './argv_parser'\nimport { checkSchema } from './check_schema'\nimport { ILogger } from '../logger'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { importer } = require('../importer')\n\nexport async function fromFile(\n logger: ILogger,\n cwd: string,\n file: string,\n profiles: string[] = []\n): Promise<Partial<IConfiguration>> {\n const definitions = await loadFile(cwd, file)\n if (!definitions.default) {\n logger.debug('No default profile defined in configuration file')\n definitions.default = {}\n }\n if (profiles.length < 1) {\n logger.debug('No profiles specified; using default profile')\n profiles = ['default']\n }\n const definedKeys = Object.keys(definitions)\n profiles.forEach((profileKey) => {\n if (!definedKeys.includes(profileKey)) {\n throw new Error(`Requested profile \"${profileKey}\" doesn't exist`)\n }\n })\n return mergeConfigurations(\n {},\n ...profiles.map((profileKey) =>\n extractConfiguration(logger, profileKey, definitions[profileKey])\n )\n )\n}\n\nasync function loadFile(\n cwd: string,\n file: string\n): Promise<Record<string, any>> {\n const filePath: string = path.join(cwd, file)\n const extension = path.extname(filePath)\n let definitions\n switch (extension) {\n case '.json':\n definitions = JSON.parse(\n await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })\n )\n break\n case '.yaml':\n case '.yml':\n definitions = YAML.parse(\n await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })\n )\n break\n default:\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n definitions = require(filePath)\n } catch (error) {\n if (error.code === 'ERR_REQUIRE_ESM') {\n definitions = await importer(pathToFileURL(filePath))\n } else {\n throw error\n }\n }\n }\n if (typeof definitions !== 'object') {\n throw new Error(`Configuration file ${filePath} does not export an object`)\n }\n return definitions\n}\n\nfunction extractConfiguration(\n logger: ILogger,\n name: string,\n definition: any\n): Partial<IConfiguration> {\n if (typeof definition === 'string') {\n logger.debug(`Profile \"${name}\" value is a string; parsing as argv`)\n const { configuration } = ArgvParser.parse([\n 'node',\n 'cucumber-js',\n ...stringArgv(definition),\n ])\n return configuration\n }\n try {\n return checkSchema(definition)\n } catch (error) {\n throw new Error(\n `Requested profile \"${name}\" failed schema validation: ${error.errors.join(\n ' '\n )}`\n )\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function isTruthyString(s: string | undefined): boolean;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTruthyString = void 0;
4
+ function isTruthyString(s) {
5
+ if (s === undefined) {
6
+ return false;
7
+ }
8
+ return s.match(/^(false|no|0)$/i) === null;
9
+ }
10
+ exports.isTruthyString = isTruthyString;
11
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/configuration/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAC,CAAqB;IAClD,IAAI,CAAC,KAAK,SAAS,EAAE;QACnB,OAAO,KAAK,CAAA;KACb;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;AAC5C,CAAC;AALD,wCAKC","sourcesContent":["export function isTruthyString(s: string | undefined): boolean {\n if (s === undefined) {\n return false\n }\n return s.match(/^(false|no|0)$/i) === null\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export { default as ArgvParser } from './argv_parser';
2
+ export * from './default_configuration';
3
+ export * from './from_file';
4
+ export * from './helpers';
5
+ export * from './merge_configurations';
6
+ export * from './option_splitter';
7
+ export * from './types';
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.ArgvParser = void 0;
21
+ var argv_parser_1 = require("./argv_parser");
22
+ Object.defineProperty(exports, "ArgvParser", { enumerable: true, get: function () { return __importDefault(argv_parser_1).default; } });
23
+ __exportStar(require("./default_configuration"), exports);
24
+ __exportStar(require("./from_file"), exports);
25
+ __exportStar(require("./helpers"), exports);
26
+ __exportStar(require("./merge_configurations"), exports);
27
+ __exportStar(require("./option_splitter"), exports);
28
+ __exportStar(require("./types"), exports);
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/configuration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6CAAqD;AAA5C,0HAAA,OAAO,OAAc;AAC9B,0DAAuC;AACvC,8CAA2B;AAC3B,4CAAyB;AACzB,yDAAsC;AACtC,oDAAiC;AACjC,0CAAuB","sourcesContent":["export { default as ArgvParser } from './argv_parser'\nexport * from './default_configuration'\nexport * from './from_file'\nexport * from './helpers'\nexport * from './merge_configurations'\nexport * from './option_splitter'\nexport * from './types'\n"]}
@@ -0,0 +1 @@
1
+ export declare function locateFile(cwd: string): string | undefined;
@@ -0,0 +1,21 @@
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.locateFile = void 0;
7
+ const fs_1 = __importDefault(require("mz/fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const DEFAULT_FILENAMES = [
10
+ 'cucumber.js',
11
+ 'cucumber.cjs',
12
+ 'cucumber.mjs',
13
+ 'cucumber.json',
14
+ 'cucumber.yaml',
15
+ 'cucumber.yml',
16
+ ];
17
+ function locateFile(cwd) {
18
+ return DEFAULT_FILENAMES.find((filename) => fs_1.default.existsSync(path_1.default.join(cwd, filename)));
19
+ }
20
+ exports.locateFile = locateFile;
21
+ //# sourceMappingURL=locate_file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locate_file.js","sourceRoot":"","sources":["../../src/configuration/locate_file.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAsB;AACtB,gDAAuB;AAEvB,MAAM,iBAAiB,GAAG;IACxB,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;CACf,CAAA;AAED,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACzC,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CACxC,CAAA;AACH,CAAC;AAJD,gCAIC","sourcesContent":["import fs from 'mz/fs'\nimport path from 'path'\n\nconst DEFAULT_FILENAMES = [\n 'cucumber.js',\n 'cucumber.cjs',\n 'cucumber.mjs',\n 'cucumber.json',\n 'cucumber.yaml',\n 'cucumber.yml',\n]\n\nexport function locateFile(cwd: string): string | undefined {\n return DEFAULT_FILENAMES.find((filename) =>\n fs.existsSync(path.join(cwd, filename))\n )\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { IConfiguration } from './types';
2
+ export declare function mergeConfigurations<T = Partial<IConfiguration>>(source: T, ...configurations: Partial<IConfiguration>[]): T;
@@ -0,0 +1,48 @@
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.mergeConfigurations = void 0;
7
+ const lodash_mergewith_1 = __importDefault(require("lodash.mergewith"));
8
+ const ADDITIVE_ARRAYS = [
9
+ 'format',
10
+ 'import',
11
+ 'name',
12
+ 'paths',
13
+ 'require',
14
+ 'requireModule',
15
+ ];
16
+ const TAG_EXPRESSIONS = ['tags', 'retryTagFilter'];
17
+ function mergeArrays(objValue, srcValue) {
18
+ if (objValue && srcValue) {
19
+ return [].concat(objValue, srcValue);
20
+ }
21
+ return undefined;
22
+ }
23
+ function mergeTagExpressions(objValue, srcValue) {
24
+ if (objValue && srcValue) {
25
+ return `${wrapTagExpression(objValue)} and ${wrapTagExpression(srcValue)}`;
26
+ }
27
+ return undefined;
28
+ }
29
+ function wrapTagExpression(raw) {
30
+ if (raw.startsWith('(') && raw.endsWith(')')) {
31
+ return raw;
32
+ }
33
+ return `(${raw})`;
34
+ }
35
+ function customizer(objValue, srcValue, key) {
36
+ if (ADDITIVE_ARRAYS.includes(key)) {
37
+ return mergeArrays(objValue, srcValue);
38
+ }
39
+ if (TAG_EXPRESSIONS.includes(key)) {
40
+ return mergeTagExpressions(objValue, srcValue);
41
+ }
42
+ return undefined;
43
+ }
44
+ function mergeConfigurations(source, ...configurations) {
45
+ return (0, lodash_mergewith_1.default)({}, source, ...configurations, customizer);
46
+ }
47
+ exports.mergeConfigurations = mergeConfigurations;
48
+ //# sourceMappingURL=merge_configurations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge_configurations.js","sourceRoot":"","sources":["../../src/configuration/merge_configurations.ts"],"names":[],"mappings":";;;;;;AACA,wEAAwC;AAExC,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,eAAe;CAChB,CAAA;AACD,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;AAElD,SAAS,WAAW,CAAC,QAAe,EAAE,QAAe;IACnD,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;KACrC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgB,EAAE,QAAgB;IAC7D,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAA;KAC3E;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC5C,OAAO,GAAG,CAAA;KACX;IACD,OAAO,IAAI,GAAG,GAAG,CAAA;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,QAAa,EAAE,QAAa,EAAE,GAAW;IAC3D,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACjC,OAAO,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;KACvC;IACD,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACjC,OAAO,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;KAC/C;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,mBAAmB,CACjC,MAAS,EACT,GAAG,cAAyC;IAE5C,OAAO,IAAA,0BAAS,EAAC,EAAE,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,UAAU,CAAC,CAAA;AAC7D,CAAC;AALD,kDAKC","sourcesContent":["import { IConfiguration } from './types'\nimport mergeWith from 'lodash.mergewith'\n\nconst ADDITIVE_ARRAYS = [\n 'format',\n 'import',\n 'name',\n 'paths',\n 'require',\n 'requireModule',\n]\nconst TAG_EXPRESSIONS = ['tags', 'retryTagFilter']\n\nfunction mergeArrays(objValue: any[], srcValue: any[]) {\n if (objValue && srcValue) {\n return [].concat(objValue, srcValue)\n }\n return undefined\n}\n\nfunction mergeTagExpressions(objValue: string, srcValue: string) {\n if (objValue && srcValue) {\n return `${wrapTagExpression(objValue)} and ${wrapTagExpression(srcValue)}`\n }\n return undefined\n}\n\nfunction wrapTagExpression(raw: string) {\n if (raw.startsWith('(') && raw.endsWith(')')) {\n return raw\n }\n return `(${raw})`\n}\n\nfunction customizer(objValue: any, srcValue: any, key: string): any {\n if (ADDITIVE_ARRAYS.includes(key)) {\n return mergeArrays(objValue, srcValue)\n }\n if (TAG_EXPRESSIONS.includes(key)) {\n return mergeTagExpressions(objValue, srcValue)\n }\n return undefined\n}\n\nexport function mergeConfigurations<T = Partial<IConfiguration>>(\n source: T,\n ...configurations: Partial<IConfiguration>[]\n): T {\n return mergeWith({}, source, ...configurations, customizer)\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const OptionSplitter: {
2
+ split(option: string): string[];
3
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OptionSplitter = void 0;
4
+ exports.OptionSplitter = {
5
+ split(option) {
6
+ option = option.replace(/"/g, '');
7
+ const parts = option.split(/((?:file){0}):(?!\\|\/\/)/);
8
+ const result = parts.reduce((memo, part, i) => {
9
+ if (partNeedsRecombined(i)) {
10
+ memo.push(parts.slice(i, i + 2).join(''));
11
+ }
12
+ return memo;
13
+ }, []);
14
+ if (result.length === 1) {
15
+ result.push('');
16
+ }
17
+ return result;
18
+ },
19
+ };
20
+ function partNeedsRecombined(i) {
21
+ return i % 2 === 0;
22
+ }
23
+ //# sourceMappingURL=option_splitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"option_splitter.js","sourceRoot":"","sources":["../../src/configuration/option_splitter.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,MAAc;QAClB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QAEjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;QAEvD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAc,EAAE,IAAY,EAAE,CAAS,EAAE,EAAE;YACtE,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;gBAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;aAC1C;YAED,OAAO,IAAI,CAAA;QACb,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SAChB;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAS,mBAAmB,CAAC,CAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AACpB,CAAC","sourcesContent":["export const OptionSplitter = {\n split(option: string): string[] {\n option = option.replace(/\"/g, '')\n\n const parts = option.split(/((?:file){0}):(?!\\\\|\\/\\/)/)\n\n const result = parts.reduce((memo: string[], part: string, i: number) => {\n if (partNeedsRecombined(i)) {\n memo.push(parts.slice(i, i + 2).join(''))\n }\n\n return memo\n }, [])\n\n if (result.length === 1) {\n result.push('')\n }\n\n return result\n },\n}\n\nfunction partNeedsRecombined(i: number): boolean {\n return i % 2 === 0\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { FormatOptions } from '../formatter';
2
+ import { PickleOrder } from '../models/pickle_order';
3
+ export interface IConfiguration {
4
+ backtrace: boolean;
5
+ dryRun: boolean;
6
+ forceExit: boolean;
7
+ failFast: boolean;
8
+ format: string[];
9
+ formatOptions: FormatOptions;
10
+ import: string[];
11
+ language: string;
12
+ name: string[];
13
+ order: PickleOrder;
14
+ paths: string[];
15
+ parallel: number;
16
+ publish: boolean;
17
+ /**
18
+ * @deprecated no longer needed; see <https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md>
19
+ */
20
+ publishQuiet: boolean;
21
+ require: string[];
22
+ requireModule: string[];
23
+ retry: number;
24
+ retryTagFilter: string;
25
+ strict: boolean;
26
+ tags: string;
27
+ worldParameters: any;
28
+ runName: string;
29
+ bvtRerun: boolean;
30
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/configuration/types.ts"],"names":[],"mappings":"","sourcesContent":["import { FormatOptions } from '../formatter'\nimport { PickleOrder } from '../models/pickle_order'\n\nexport interface IConfiguration {\n backtrace: boolean\n dryRun: boolean\n forceExit: boolean\n failFast: boolean\n format: string[]\n formatOptions: FormatOptions\n import: string[]\n language: string\n name: string[]\n order: PickleOrder\n paths: string[]\n parallel: number\n publish: boolean\n /**\n * @deprecated no longer needed; see <https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md>\n */\n publishQuiet: boolean\n require: string[]\n requireModule: string[]\n retry: number\n retryTagFilter: string\n strict: boolean\n tags: string\n worldParameters: any\n runName: string\n bvtRerun: boolean\n}\n"]}