@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.
- package/README.md +8 -3
- package/bin/cucumber.js +2 -1
- package/lib/api/convert_configuration.d.ts +3 -4
- package/lib/api/convert_configuration.js +9 -11
- package/lib/api/emit_support_code_messages.d.ts +3 -3
- package/lib/api/emit_support_code_messages.js +13 -28
- package/lib/api/formatters.d.ts +7 -7
- package/lib/api/formatters.js +5 -2
- package/lib/api/gherkin.d.ts +3 -3
- package/lib/api/gherkin.js +2 -4
- package/lib/api/index.d.ts +2 -2
- package/lib/api/index.js +1 -1
- package/lib/api/load_configuration.d.ts +2 -2
- package/lib/api/load_configuration.js +4 -5
- package/lib/api/load_sources.d.ts +2 -2
- package/lib/api/load_sources.js +2 -2
- package/lib/api/load_support.d.ts +2 -2
- package/lib/api/load_support.js +3 -3
- package/lib/api/plugins.d.ts +2 -2
- package/lib/api/plugins.js +2 -2
- package/lib/api/run_cucumber.d.ts +3 -3
- package/lib/api/run_cucumber.js +17 -1
- package/lib/api/support.d.ts +3 -3
- package/lib/api/support.js +5 -5
- package/lib/api/test_helpers.d.ts +1 -1
- package/lib/api/test_helpers.js +8 -10
- package/lib/api/types.d.ts +9 -5
- package/lib/api/types.js +1 -1
- package/lib/assemble/assemble_test_cases.d.ts +4 -4
- package/lib/assemble/assemble_test_cases.js +2 -6
- package/lib/assemble/index.js +1 -1
- package/lib/assemble/types.d.ts +1 -1
- package/lib/assemble/types.js +1 -1
- package/lib/cli/i18n.js +5 -3
- package/lib/cli/index.d.ts +1 -1
- package/lib/cli/index.js +2 -2
- package/lib/cli/install_validator.js +4 -3
- package/lib/cli/run.js +7 -6
- package/lib/cli/validate_node_engine_version.js +2 -4
- package/lib/configuration/argv_parser.d.ts +1 -1
- package/lib/configuration/argv_parser.js +7 -7
- package/lib/configuration/check_schema.d.ts +1 -1
- package/lib/configuration/check_schema.js +17 -6
- package/lib/configuration/default_configuration.d.ts +1 -1
- package/lib/configuration/default_configuration.js +2 -1
- package/lib/configuration/from_file.d.ts +2 -2
- package/lib/configuration/from_file.js +6 -6
- package/lib/configuration/helpers.js +1 -1
- package/lib/configuration/index.js +1 -1
- package/lib/configuration/locate_file.js +3 -3
- package/lib/configuration/merge_configurations.d.ts +1 -1
- package/lib/configuration/merge_configurations.js +2 -10
- package/lib/configuration/parse_configuration.d.ts +2 -2
- package/lib/configuration/parse_configuration.js +3 -11
- package/lib/configuration/split_format_descriptor.d.ts +1 -2
- package/lib/configuration/split_format_descriptor.js +11 -71
- package/lib/configuration/types.d.ts +26 -3
- package/lib/configuration/types.js +1 -1
- package/lib/configuration/validate_configuration.d.ts +2 -2
- package/lib/configuration/validate_configuration.js +5 -3
- package/lib/environment/console_logger.d.ts +2 -2
- package/lib/environment/console_logger.js +1 -1
- package/lib/environment/index.js +1 -1
- package/lib/environment/make_environment.d.ts +1 -1
- package/lib/environment/make_environment.js +1 -1
- package/lib/environment/types.d.ts +1 -1
- package/lib/environment/types.js +1 -1
- package/lib/filter/filter_plugin.d.ts +1 -1
- package/lib/filter/filter_plugin.js +1 -1
- package/lib/filter/index.d.ts +1 -1
- package/lib/filter/index.js +2 -2
- package/lib/filter/order_pickles.d.ts +2 -2
- package/lib/filter/order_pickles.js +1 -1
- package/lib/filter/types.d.ts +1 -1
- package/lib/filter/types.js +1 -1
- package/lib/filter_stack_trace.d.ts +1 -1
- package/lib/filter_stack_trace.js +1 -1
- package/lib/formatter/builder.d.ts +7 -6
- package/lib/formatter/builder.js +6 -7
- package/lib/formatter/builtin/html.js +2 -2
- package/lib/formatter/builtin/index.d.ts +4 -4
- package/lib/formatter/builtin/index.js +14 -13
- package/lib/formatter/builtin/message.js +2 -2
- package/lib/formatter/builtin/pretty.d.ts +6 -0
- package/lib/formatter/builtin/pretty.js +19 -0
- package/lib/formatter/builtin/progress-bar.d.ts +6 -0
- package/lib/formatter/builtin/progress-bar.js +22 -0
- package/lib/formatter/builtin/progress.d.ts +6 -0
- package/lib/formatter/builtin/progress.js +18 -0
- package/lib/formatter/builtin/resolve_terminal_options.d.ts +3 -0
- package/lib/formatter/builtin/resolve_terminal_options.js +15 -0
- package/lib/formatter/builtin/summary.d.ts +6 -0
- package/lib/formatter/builtin/summary.js +15 -0
- package/lib/formatter/create_stream.d.ts +2 -2
- package/lib/formatter/create_stream.js +3 -5
- package/lib/formatter/find_class_or_plugin.js +1 -1
- package/lib/formatter/get_color_fns.d.ts +3 -3
- package/lib/formatter/get_color_fns.js +23 -52
- package/lib/formatter/helpers/duration_helpers.d.ts +1 -1
- package/lib/formatter/helpers/duration_helpers.js +1 -1
- package/lib/formatter/helpers/event_data_collector.d.ts +2 -2
- package/lib/formatter/helpers/event_data_collector.js +4 -6
- package/lib/formatter/helpers/formatters.d.ts +1 -1
- package/lib/formatter/helpers/formatters.js +1 -3
- package/lib/formatter/helpers/gherkin_document_parser.d.ts +1 -1
- package/lib/formatter/helpers/gherkin_document_parser.js +20 -18
- package/lib/formatter/helpers/index.d.ts +3 -3
- package/lib/formatter/helpers/index.js +8 -8
- package/lib/formatter/helpers/issue_helpers.d.ts +5 -5
- package/lib/formatter/helpers/issue_helpers.js +2 -2
- package/lib/formatter/helpers/keyword_type.js +2 -2
- package/lib/formatter/helpers/location_helpers.d.ts +1 -1
- package/lib/formatter/helpers/location_helpers.js +1 -1
- package/lib/formatter/helpers/pickle_parser.d.ts +2 -2
- package/lib/formatter/helpers/pickle_parser.js +8 -9
- package/lib/formatter/helpers/step_argument_formatter.d.ts +1 -1
- package/lib/formatter/helpers/step_argument_formatter.js +1 -1
- package/lib/formatter/helpers/summary_helpers.d.ts +2 -2
- package/lib/formatter/helpers/summary_helpers.js +8 -4
- package/lib/formatter/helpers/test_case_attempt_formatter.d.ts +4 -4
- package/lib/formatter/helpers/test_case_attempt_formatter.js +5 -5
- package/lib/formatter/helpers/test_case_attempt_parser.d.ts +4 -4
- package/lib/formatter/helpers/test_case_attempt_parser.js +4 -9
- package/lib/formatter/helpers/usage_helpers/index.d.ts +3 -3
- package/lib/formatter/helpers/usage_helpers/index.js +5 -6
- package/lib/formatter/import_code.js +2 -2
- package/lib/formatter/index.d.ts +25 -13
- package/lib/formatter/index.js +2 -2
- package/lib/formatter/json_formatter.d.ts +2 -2
- package/lib/formatter/json_formatter.js +9 -14
- package/lib/formatter/progress_formatter.d.ts +4 -1
- package/lib/formatter/progress_formatter.js +4 -1
- package/lib/formatter/rerun_formatter.d.ts +1 -1
- package/lib/formatter/rerun_formatter.js +2 -2
- package/lib/formatter/resolve_implementation.d.ts +1 -1
- package/lib/formatter/resolve_implementation.js +2 -2
- package/lib/formatter/snippets_formatter.d.ts +1 -1
- package/lib/formatter/snippets_formatter.js +2 -2
- package/lib/formatter/step_definition_snippet_builder/index.d.ts +4 -4
- package/lib/formatter/step_definition_snippet_builder/index.js +3 -3
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts +1 -1
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +3 -5
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts +1 -1
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js +1 -1
- package/lib/formatter/summary_formatter.d.ts +6 -3
- package/lib/formatter/summary_formatter.js +6 -3
- package/lib/formatter/usage_formatter.d.ts +1 -1
- package/lib/formatter/usage_formatter.js +4 -4
- package/lib/formatter/usage_json_formatter.d.ts +1 -1
- package/lib/formatter/usage_json_formatter.js +3 -3
- package/lib/index.d.ts +6 -11
- package/lib/index.js +13 -20
- package/lib/models/data_table.d.ts +1 -1
- package/lib/models/data_table.js +9 -5
- package/lib/models/definition.d.ts +4 -4
- package/lib/models/definition.js +1 -1
- package/lib/models/gherkin_step_keyword.js +1 -1
- package/lib/models/step_definition.d.ts +3 -3
- package/lib/models/step_definition.js +1 -1
- package/lib/models/test_case_hook_definition.d.ts +2 -2
- package/lib/models/test_case_hook_definition.js +1 -1
- package/lib/models/test_run_hook_definition.d.ts +1 -1
- package/lib/models/test_run_hook_definition.js +1 -1
- package/lib/models/test_step_hook_definition.d.ts +2 -2
- package/lib/models/test_step_hook_definition.js +1 -1
- package/lib/paths/index.js +1 -1
- package/lib/paths/paths.d.ts +3 -3
- package/lib/paths/paths.js +42 -18
- package/lib/paths/types.js +1 -1
- package/lib/pickle_filter.d.ts +1 -1
- package/lib/pickle_filter.js +3 -3
- package/lib/plugin/index.d.ts +1 -1
- package/lib/plugin/index.js +2 -2
- package/lib/plugin/plugin_manager.d.ts +2 -2
- package/lib/plugin/plugin_manager.js +1 -1
- package/lib/plugin/types.d.ts +59 -9
- package/lib/plugin/types.js +1 -1
- package/lib/publish/index.js +1 -1
- package/lib/publish/publish_plugin.d.ts +1 -1
- package/lib/publish/publish_plugin.js +14 -15
- package/lib/publish/types.js +1 -1
- package/lib/runtime/attachment_manager/index.d.ts +1 -1
- package/lib/runtime/attachment_manager/index.js +3 -6
- package/lib/runtime/coordinator.d.ts +13 -6
- package/lib/runtime/coordinator.js +26 -18
- package/lib/runtime/format_error.d.ts +1 -1
- package/lib/runtime/format_error.js +43 -15
- package/lib/runtime/helpers.d.ts +2 -2
- package/lib/runtime/helpers.js +2 -2
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/make_runtime.d.ts +10 -9
- package/lib/runtime/make_runtime.js +4 -5
- package/lib/runtime/make_suggestion.d.ts +2 -2
- package/lib/runtime/make_suggestion.js +1 -1
- package/lib/runtime/parallel/adapter.d.ts +27 -39
- package/lib/runtime/parallel/adapter.js +124 -122
- package/lib/runtime/parallel/test_cases_phase.d.ts +19 -0
- package/lib/runtime/parallel/test_cases_phase.js +63 -0
- package/lib/runtime/parallel/test_run_hooks_phase.d.ts +11 -0
- package/lib/runtime/parallel/test_run_hooks_phase.js +33 -0
- package/lib/runtime/parallel/types.d.ts +38 -22
- package/lib/runtime/parallel/types.js +1 -1
- package/lib/runtime/parallel/worker.mjs +65 -0
- package/lib/runtime/scope/index.js +1 -1
- package/lib/runtime/scope/make_proxy.js +1 -1
- package/lib/runtime/scope/test_case_scope.d.ts +1 -1
- package/lib/runtime/scope/test_case_scope.js +1 -1
- package/lib/runtime/scope/test_run_scope.d.ts +1 -1
- package/lib/runtime/scope/test_run_scope.js +1 -1
- package/lib/runtime/serial/adapter.d.ts +15 -9
- package/lib/runtime/serial/adapter.js +21 -9
- package/lib/runtime/step_runner.d.ts +2 -2
- package/lib/runtime/step_runner.js +2 -2
- package/lib/runtime/stopwatch.d.ts +1 -1
- package/lib/runtime/stopwatch.js +1 -1
- package/lib/runtime/test_case_runner.d.ts +10 -9
- package/lib/runtime/test_case_runner.js +20 -12
- package/lib/runtime/types.d.ts +7 -3
- package/lib/runtime/types.js +1 -1
- package/lib/runtime/worker.d.ts +14 -13
- package/lib/runtime/worker.js +26 -44
- package/lib/sharding/index.js +1 -1
- package/lib/sharding/sharding_plugin.d.ts +1 -1
- package/lib/sharding/sharding_plugin.js +1 -1
- package/lib/step_arguments.d.ts +1 -1
- package/lib/step_arguments.js +1 -1
- package/lib/support_code_library_builder/build_parameter_type.d.ts +1 -1
- package/lib/support_code_library_builder/build_parameter_type.js +5 -3
- package/lib/support_code_library_builder/context.js +1 -1
- package/lib/support_code_library_builder/get_definition_line_and_uri.d.ts +1 -1
- package/lib/support_code_library_builder/get_definition_line_and_uri.js +1 -1
- package/lib/support_code_library_builder/index.d.ts +7 -7
- package/lib/support_code_library_builder/index.js +9 -9
- package/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts +1 -1
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js +3 -4
- package/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts +2 -2
- package/lib/support_code_library_builder/sourced_parameter_type_registry.js +1 -1
- package/lib/support_code_library_builder/types.d.ts +8 -8
- package/lib/support_code_library_builder/types.js +1 -1
- package/lib/support_code_library_builder/validate_arguments.d.ts +1 -1
- package/lib/support_code_library_builder/validate_arguments.js +1 -1
- package/lib/support_code_library_builder/world.d.ts +2 -2
- package/lib/support_code_library_builder/world.js +2 -2
- package/lib/time.js +2 -2
- package/lib/try_require.js +3 -2
- package/lib/types/index.js +1 -1
- package/lib/uncaught_exception_manager.js +1 -1
- package/lib/user_code_runner.d.ts +1 -1
- package/lib/user_code_runner.js +3 -3
- package/lib/value_checker.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +2 -2
- package/lib/wrapper.mjs +1 -5
- package/package.json +40 -63
- package/lib/api/convert_configuration.js.map +0 -1
- package/lib/api/emit_support_code_messages.js.map +0 -1
- package/lib/api/formatters.js.map +0 -1
- package/lib/api/gherkin.js.map +0 -1
- package/lib/api/index.js.map +0 -1
- package/lib/api/load_configuration.js.map +0 -1
- package/lib/api/load_sources.js.map +0 -1
- package/lib/api/load_support.js.map +0 -1
- package/lib/api/plugins.js.map +0 -1
- package/lib/api/run_cucumber.js.map +0 -1
- package/lib/api/support.js.map +0 -1
- package/lib/api/test_helpers.js.map +0 -1
- package/lib/api/types.js.map +0 -1
- package/lib/assemble/assemble_test_cases.js.map +0 -1
- package/lib/assemble/index.js.map +0 -1
- package/lib/assemble/types.js.map +0 -1
- package/lib/cli/i18n.js.map +0 -1
- package/lib/cli/index.js.map +0 -1
- package/lib/cli/install_validator.js.map +0 -1
- package/lib/cli/run.js.map +0 -1
- package/lib/cli/validate_node_engine_version.js.map +0 -1
- package/lib/configuration/argv_parser.js.map +0 -1
- package/lib/configuration/check_schema.js.map +0 -1
- package/lib/configuration/default_configuration.js.map +0 -1
- package/lib/configuration/from_file.js.map +0 -1
- package/lib/configuration/helpers.js.map +0 -1
- package/lib/configuration/index.js.map +0 -1
- package/lib/configuration/locate_file.js.map +0 -1
- package/lib/configuration/merge_configurations.js.map +0 -1
- package/lib/configuration/parse_configuration.js.map +0 -1
- package/lib/configuration/split_format_descriptor.js.map +0 -1
- package/lib/configuration/types.js.map +0 -1
- package/lib/configuration/validate_configuration.js.map +0 -1
- package/lib/environment/console_logger.js.map +0 -1
- package/lib/environment/index.js.map +0 -1
- package/lib/environment/make_environment.js.map +0 -1
- package/lib/environment/types.js.map +0 -1
- package/lib/filter/filter_plugin.js.map +0 -1
- package/lib/filter/index.js.map +0 -1
- package/lib/filter/order_pickles.js.map +0 -1
- package/lib/filter/types.js.map +0 -1
- package/lib/filter_stack_trace.js.map +0 -1
- package/lib/formatter/builder.js.map +0 -1
- package/lib/formatter/builtin/html.js.map +0 -1
- package/lib/formatter/builtin/index.js.map +0 -1
- package/lib/formatter/builtin/message.js.map +0 -1
- package/lib/formatter/create_stream.js.map +0 -1
- package/lib/formatter/find_class_or_plugin.js.map +0 -1
- package/lib/formatter/get_color_fns.js.map +0 -1
- package/lib/formatter/helpers/duration_helpers.js.map +0 -1
- package/lib/formatter/helpers/event_data_collector.js.map +0 -1
- package/lib/formatter/helpers/formatters.js.map +0 -1
- package/lib/formatter/helpers/gherkin_document_parser.js.map +0 -1
- package/lib/formatter/helpers/index.js.map +0 -1
- package/lib/formatter/helpers/issue_helpers.js.map +0 -1
- package/lib/formatter/helpers/keyword_type.js.map +0 -1
- package/lib/formatter/helpers/location_helpers.js.map +0 -1
- package/lib/formatter/helpers/pickle_parser.js.map +0 -1
- package/lib/formatter/helpers/step_argument_formatter.js.map +0 -1
- package/lib/formatter/helpers/summary_helpers.js.map +0 -1
- package/lib/formatter/helpers/test_case_attempt_formatter.js.map +0 -1
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +0 -1
- package/lib/formatter/helpers/usage_helpers/index.js.map +0 -1
- package/lib/formatter/import_code.js.map +0 -1
- package/lib/formatter/index.js.map +0 -1
- package/lib/formatter/json_formatter.js.map +0 -1
- package/lib/formatter/progress_bar_formatter.d.ts +0 -18
- package/lib/formatter/progress_bar_formatter.js +0 -103
- package/lib/formatter/progress_bar_formatter.js.map +0 -1
- package/lib/formatter/progress_formatter.js.map +0 -1
- package/lib/formatter/rerun_formatter.js.map +0 -1
- package/lib/formatter/resolve_implementation.js.map +0 -1
- package/lib/formatter/snippets_formatter.js.map +0 -1
- package/lib/formatter/step_definition_snippet_builder/index.js.map +0 -1
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +0 -1
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +0 -1
- package/lib/formatter/summary_formatter.js.map +0 -1
- package/lib/formatter/usage_formatter.js.map +0 -1
- package/lib/formatter/usage_json_formatter.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/models/data_table.js.map +0 -1
- package/lib/models/definition.js.map +0 -1
- package/lib/models/gherkin_step_keyword.js.map +0 -1
- package/lib/models/step_definition.js.map +0 -1
- package/lib/models/test_case_hook_definition.js.map +0 -1
- package/lib/models/test_run_hook_definition.js.map +0 -1
- package/lib/models/test_step_hook_definition.js.map +0 -1
- package/lib/paths/index.js.map +0 -1
- package/lib/paths/paths.js.map +0 -1
- package/lib/paths/types.js.map +0 -1
- package/lib/pickle_filter.js.map +0 -1
- package/lib/plugin/index.js.map +0 -1
- package/lib/plugin/plugin_manager.js.map +0 -1
- package/lib/plugin/types.js.map +0 -1
- package/lib/publish/index.js.map +0 -1
- package/lib/publish/publish_plugin.js.map +0 -1
- package/lib/publish/types.js.map +0 -1
- package/lib/runtime/attachment_manager/index.js.map +0 -1
- package/lib/runtime/coordinator.js.map +0 -1
- package/lib/runtime/format_error.js.map +0 -1
- package/lib/runtime/helpers.js.map +0 -1
- package/lib/runtime/index.js.map +0 -1
- package/lib/runtime/make_runtime.js.map +0 -1
- package/lib/runtime/make_suggestion.js.map +0 -1
- package/lib/runtime/parallel/adapter.js.map +0 -1
- package/lib/runtime/parallel/run_worker.js +0 -25
- package/lib/runtime/parallel/run_worker.js.map +0 -1
- package/lib/runtime/parallel/types.js.map +0 -1
- package/lib/runtime/parallel/worker.d.ts +0 -25
- package/lib/runtime/parallel/worker.js +0 -83
- package/lib/runtime/parallel/worker.js.map +0 -1
- package/lib/runtime/scope/index.js.map +0 -1
- package/lib/runtime/scope/make_proxy.js.map +0 -1
- package/lib/runtime/scope/test_case_scope.js.map +0 -1
- package/lib/runtime/scope/test_run_scope.js.map +0 -1
- package/lib/runtime/serial/adapter.js.map +0 -1
- package/lib/runtime/step_runner.js.map +0 -1
- package/lib/runtime/stopwatch.js.map +0 -1
- package/lib/runtime/test_case_runner.js.map +0 -1
- package/lib/runtime/types.js.map +0 -1
- package/lib/runtime/worker.js.map +0 -1
- package/lib/sharding/index.js.map +0 -1
- package/lib/sharding/sharding_plugin.js.map +0 -1
- package/lib/step_arguments.js.map +0 -1
- package/lib/support_code_library_builder/build_parameter_type.js.map +0 -1
- package/lib/support_code_library_builder/context.js.map +0 -1
- package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +0 -1
- package/lib/support_code_library_builder/index.js.map +0 -1
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js.map +0 -1
- package/lib/support_code_library_builder/sourced_parameter_type_registry.js.map +0 -1
- package/lib/support_code_library_builder/types.js.map +0 -1
- package/lib/support_code_library_builder/validate_arguments.js.map +0 -1
- package/lib/support_code_library_builder/world.js.map +0 -1
- package/lib/time.js.map +0 -1
- package/lib/try_require.js.map +0 -1
- package/lib/tsconfig.node.tsbuildinfo +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/uncaught_exception_manager.js.map +0 -1
- package/lib/user_code_runner.js.map +0 -1
- package/lib/value_checker.js.map +0 -1
- package/lib/version.js.map +0 -1
- /package/lib/runtime/parallel/{run_worker.d.ts → worker.d.mts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"from_file.js","sourceRoot":"","sources":["../../src/configuration/from_file.ts"],"names":[],"mappings":";;;;;AAsBA,4BA4CC;AAlED,sDAAwB;AACxB,0DAA4B;AAC5B,yCAAqC;AACrC,uCAAwC;AACxC,gDAAuB;AAGvB,iEAA4D;AAC5D,+DAA0D;AAE1D,MAAM,oBAAoB,GAAG;IAC3B,OAAO;IACP,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;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M,CAAC,KAAK,CACV,+BAA+B,IAAI,2BAA2B,aAAa,CAAC,IAAI,gBAAgB,CACjG,CAAA;wBACD,iEAAiE;wBACjE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;oBACjC,CAAC;gBACH,CAAC;gBACD,MAAK;QACT,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,wBAAwB,EAAE;YACnE,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,4BAA4B,CAAC,CAAA;IAC7E,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,QAAgB;IAC7C,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzD,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,EAAE,GAAG,EAAE,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC1E,OAAO,aAAa,EAAE,WAAW,CAAA;AACnC,CAAC","sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { pathToFileURL } from 'node:url'\nimport YAML from 'yaml'\nimport { ILogger } from '../environment'\nimport { IConfiguration } from './types'\nimport { mergeConfigurations } from './merge_configurations'\nimport { parseConfiguration } from './parse_configuration'\n\nconst SUPPORTED_EXTENSIONS = [\n '.json',\n '.yaml',\n '.yml',\n '.js',\n '.cjs',\n '.mjs',\n '.ts',\n '.cts',\n '.mts',\n]\n\nexport async function fromFile(\n logger: ILogger,\n cwd: string,\n file: string,\n profiles: string[] = []\n): Promise<Partial<IConfiguration>> {\n let definitions = await loadFile(logger, cwd, file)\n\n const defaultDefinition: unknown = definitions.default\n\n if (defaultDefinition) {\n if (typeof defaultDefinition === 'function') {\n logger.debug('Default function found; loading profiles')\n definitions = await handleDefaultFunctionDefinition(\n definitions,\n defaultDefinition\n )\n }\n } else {\n logger.debug('No default profile defined in configuration file')\n definitions.default = {}\n }\n\n if (profiles.length < 1) {\n logger.debug('No profiles specified; using default profile')\n profiles = ['default']\n }\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 parseConfiguration(\n logger,\n `Profile \"${profileKey}\"`,\n definitions[profileKey]\n )\n )\n )\n}\n\nasync function handleDefaultFunctionDefinition(\n definitions: Record<string, any>,\n defaultDefinition: Function\n): Promise<Record<string, any>> {\n if (Object.keys(definitions).length > 1) {\n throw new Error(\n 'Invalid profiles specified: if a default function definition is provided, no other static profiles should be specified'\n )\n }\n\n const definitionsFromDefault = await defaultDefinition()\n\n return {\n default: {},\n ...definitionsFromDefault,\n }\n}\n\nasync function loadFile(\n logger: ILogger,\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 if (!SUPPORTED_EXTENSIONS.includes(extension)) {\n throw new Error(`Unsupported configuration file extension \"${extension}\"`)\n }\n let definitions\n try {\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 case '.cjs':\n logger.debug(\n `Loading configuration file \"${file}\" as CommonJS based on extension`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n break\n case '.cts':\n logger.debug(\n `Loading configuration file \"${file}\" as TypeScript based on extension`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n break\n case '.mjs':\n logger.debug(\n `Loading configuration file \"${file}\" as ESM based on extension`\n )\n definitions = await import(pathToFileURL(filePath).toString())\n break\n case '.mts':\n case '.ts':\n logger.debug(\n `Loading configuration file \"${file}\" as TypeScript based on extension`\n )\n definitions = await import(pathToFileURL(filePath).toString())\n break\n case '.js':\n {\n const parentPackage = await readPackageJson(filePath)\n if (!parentPackage) {\n logger.debug(\n `Loading configuration file \"${file}\" as CommonJS based on absence of a parent package`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n } else if (parentPackage.type === 'module') {\n logger.debug(\n `Loading configuration file \"${file}\" as ESM based on \"${parentPackage.name}\" package type`\n )\n definitions = await import(pathToFileURL(filePath).toString())\n } else {\n logger.debug(\n `Loading configuration file \"${file}\" as CommonJS based on \"${parentPackage.name}\" package type`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n }\n }\n break\n }\n } catch (error) {\n throw new Error(`Configuration file \"${file}\" failed to load/parse`, {\n cause: 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\nasync function readPackageJson(filePath: string) {\n const { readPackageUp } = await import('read-package-up')\n const parentPackage = await readPackageUp({ cwd: path.dirname(filePath) })\n return parentPackage?.packageJson\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/configuration/helpers.ts"],"names":[],"mappings":";;AAAA,wCAKC;AALD,SAAgB,cAAc,CAAC,CAAqB;IAClD,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACpB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;AAC5C,CAAC","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"]}
|
|
@@ -1 +0,0 @@
|
|
|
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,wDAAqC;AACrC,4DAAyC;AACzC,0CAAuB;AACvB,2DAAwC","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 './parse_configuration'\nexport * from './split_format_descriptor'\nexport * from './types'\nexport * from './validate_configuration'\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locate_file.js","sourceRoot":"","sources":["../../src/configuration/locate_file.ts"],"names":[],"mappings":";;;;;AAYA,gCAIC;AAhBD,0DAA4B;AAC5B,+CAAsB;AAEtB,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,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CACxC,CAAA;AACH,CAAC","sourcesContent":["import path from 'node:path'\nimport fs from 'mz/fs'\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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"merge_configurations.js","sourceRoot":"","sources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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","sourcesContent":["import mergeWith from 'lodash.mergewith'\nimport { IConfiguration } from './types'\n\nconst ADDITIVE_ARRAYS = [\n 'format',\n 'import',\n 'loader',\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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse_configuration.js","sourceRoot":"","sources":["../../src/configuration/parse_configuration.ts"],"names":[],"mappings":";;;;;AAMA,gDAmCC;AAzCD,8DAAoC;AAGpC,gEAAsC;AACtC,iDAA4C;AAE5C,SAAgB,kBAAkB,CAChC,MAAe,EACf,MAAc,EACd,UAAmE;IAEnE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,EAAE,CAAA;IACX,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,mDAAmD,CAAC,CAAA;QAC1E,MAAM,EAAE,aAAa,EAAE,GAAG,qBAAU,CAAC,KAAK,CAAC;YACzC,MAAM;YACN,aAAa;YACb,GAAG,UAAU;SACd,CAAC,CAAA;QACF,OAAO,aAAa,CAAA;IACtB,CAAC;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,mDAAmD,CAAC,CAAA;QAC1E,MAAM,EAAE,aAAa,EAAE,GAAG,qBAAU,CAAC,KAAK,CAAC;YACzC,MAAM;YACN,aAAa;YACb,GAAG,IAAA,qBAAU,EAAC,UAAU,CAAC;SAC1B,CAAC,CAAA;QACF,OAAO,aAAa,CAAA;IACtB,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAA,0BAAW,EAAC,UAAU,CAAC,CAAA;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,kDAAkD,KAAK,CAAC,MAAM,CAAC,IAAI,CAC1E,GAAG,CACJ,EAAE,CACJ,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["import stringArgv from 'string-argv'\nimport { ILogger } from '../environment'\nimport { IConfiguration } from './types'\nimport ArgvParser from './argv_parser'\nimport { checkSchema } from './check_schema'\n\nexport function parseConfiguration(\n logger: ILogger,\n source: string,\n definition: Partial<IConfiguration> | string[] | string | undefined\n): Partial<IConfiguration> {\n if (!definition) {\n return {}\n }\n if (Array.isArray(definition)) {\n logger.debug(`${source} configuration value is an array; parsing as argv`)\n const { configuration } = ArgvParser.parse([\n 'node',\n 'cucumber-js',\n ...definition,\n ])\n return configuration\n }\n if (typeof definition === 'string') {\n logger.debug(`${source} configuration 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 `${source} configuration value failed schema validation: ${error.errors.join(\n ' '\n )}`\n )\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"split_format_descriptor.js","sourceRoot":"","sources":["../../src/configuration/split_format_descriptor.ts"],"names":[],"mappings":";;AAEA,sDA6EC;AA7ED,SAAgB,qBAAqB,CACnC,MAAe,EACf,MAAc;IAEd,MAAM,SAAS,GAAG,CAAC,MAAgB,EAAE,EAAE;QACrC,IAAI,QAAQ,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAA;QAC/B,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACd,QAAQ,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAA;QAC/B,CAAC;QACD,MAAM,CAAC,IAAI,CACT;YACM,QAAQ,EAAE,CACjB,CAAA;IACH,CAAC,CAAA;IACD,IAAI,MAAgB,CAAA;IACpB,IAAI,MAAM,EAAE,MAAM,CAAA;IAElB,2BAA2B;IAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACzD,cAAc;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACvD,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QACjC,CAAC;QACD,YAAY;aACP,CAAC;YACJ,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/B,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC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B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC1D,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7C,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QACvB,CAAC;QACD,SAAS,CAAC,MAAM,CAAC,CAAA;IACnB,CAAC;IACD,UAAU;SACL,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC5D,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,SAAS,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IACD,MAAM;SACD,CAAC;QACJ,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACvB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { ILogger } from '../environment'\n\nexport function splitFormatDescriptor(\n logger: ILogger,\n option: string\n): string[] {\n const doWarning = (result: string[]) => {\n let expected = `\"${result[0]}\"`\n if (result[1]) {\n expected += `:\"${result[1]}\"`\n }\n logger.warn(\n `Each part of a user-specified format should be quoted; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md#ambiguous-colons-in-formats\nChange to ${expected}`\n )\n }\n let result: string[]\n let match1, match2\n\n // \"foo\":\"bar\" or \"foo\":bar\n if ((match1 = option.match(/^\"([^\"]*)\":(.*)$/)) !== null) {\n // \"foo\":\"bar\"\n if ((match2 = match1[2].match(/^\"([^\"]*)\"$/)) !== null) {\n result = [match1[1], match2[1]]\n }\n // \"foo\":bar\n else {\n result = [match1[1], match1[2]]\n if (result[1].includes(':')) {\n doWarning(result)\n }\n }\n }\n // foo:\"bar\"\n else if ((match1 = option.match(/^(.*):\"([^\"]*)\"$/)) !== null) {\n result = [match1[1], match1[2]]\n if (result[0].includes(':')) {\n doWarning(result)\n }\n }\n // \"foo\"\n else if ((match1 = option.match(/^\"([^\"]*)\"$/)) !== null) {\n result = [match1[1], '']\n }\n // file://foo or file:///foo or file://C:/foo or file://C:\\foo or file:///C:/foo or file:///C:\\foo\n else if (\n (match1 = option.match(/^(file:\\/{2,3}(?:[a-zA-Z]:[/\\\\])?)(.*)$/)) !== null\n ) {\n // file://foo:bar\n if ((match2 = match1[2].match(/^([^:]*):(.*)$/)) !== null) {\n result = [match1[1] + match2[1], match2[2]]\n } else {\n result = [option, '']\n }\n doWarning(result)\n }\n // C:\\foo or C:/foo\n else if ((match1 = option.match(/^([a-zA-Z]:[/\\\\])(.*)$/)) !== null) {\n // C:\\foo:bar or C:/foo:bar\n if ((match2 = match1[2].match(/^([^:]*):(.*)$/)) !== null) {\n result = [match1[1] + match2[1], match2[2]]\n } else {\n result = [option, '']\n }\n doWarning(result)\n }\n // foo:bar\n else if ((match1 = option.match(/^([^:]*):(.*)$/)) !== null) {\n result = [match1[1], match1[2]]\n if (option.split(':').length > 2) {\n doWarning(result)\n }\n }\n // foo\n else {\n result = [option, '']\n }\n\n return result\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/configuration/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonObject } from 'type-fest'\nimport { IPickleOrder } from '../filter'\n\n/**\n * User-defined configuration\n *\n * @public\n */\nexport interface IConfiguration {\n /**\n * Paths to where your feature files are\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-features}\n */\n paths: string[]\n /**\n * Show the full backtrace for errors\n * @default false\n */\n backtrace: boolean\n /**\n * Perform a dry run, where a test run is prepared but nothing is executed\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/dry_run.md}\n */\n dryRun: boolean\n /**\n * Explicitly call `process.exit()` after the test run\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md#exiting}\n * @remarks\n * This option is only used by the CLI.\n */\n forceExit: boolean\n /**\n * Stop running tests when a test fails\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/fail_fast.md}\n */\n failFast: boolean\n /**\n * Name/path and (optionally) output file path of each formatter to use\n *\n * @example\n * [\n * \"\\@cucumber/pretty-formatter\",\n * [\"html\", \"./reports/cucumber.html\"],\n * [\"./custom-formatter.js\", \"./reports/custom.txt\"]\n * ]\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md}\n * @remarks\n * Each item has one or two values. The first (required) identifies the\n * formatter to be used. The second (optional) specifies where the output\n * should be written.\n */\n format: Array<string | [string, string?]>\n /**\n * Options to be provided to formatters\n * @default \\{\\}\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md#options}\n * @remarks\n * The value must be a JSON-serializable object.\n */\n formatOptions: JsonObject\n /**\n * Name/path of each plugin to use\n *\n * @example\n * [\n * \"\\@cucumber/my-plugin\",\n * \"./custom-plugin.js\"\n * ]\n * @default []\n * @remarks\n * Each item is a module specifier for a plugin to be loaded.\n */\n plugin: string[]\n /**\n * Options to be provided to plugins\n * @default \\{\\}\n * @remarks\n * The value must be a JSON-serializable object.\n */\n pluginOptions: JsonObject\n /**\n * Paths to where your support code is\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code}\n */\n import: string[]\n /**\n * Default language for your feature files\n * @default \"en\"\n */\n language: string\n /**\n * Module specifier(s) for loaders to be registered ahead of loading support code\n * @default []\n */\n loader: string[]\n /**\n * Regular expressions of which scenario names should match one of to be run\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#names}\n */\n name: string[]\n /**\n * Run in the order defined, or in a random order\n * @default \"defined\"\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#order}\n */\n order: IPickleOrder\n /**\n * Run tests in parallel with the given number of worker processes\n * @default 0\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/parallel.md}\n */\n parallel: number\n /**\n * Shard tests and execute only the selected shard, format `<index>/<total>`\n * @default \"\"\n */\n shard: string\n /**\n * Publish a report of your test run to https://reports.cucumber.io/\n * @default false\n */\n publish: boolean\n /**\n * Paths to where your support code is, for CommonJS\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code}\n */\n require: string[]\n /**\n * Names of transpilation modules to load, via `require()`\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/transpiling.md}\n */\n requireModule: string[]\n /**\n * Retry failing tests up to the given number of times\n * @default 0\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md}\n */\n retry: number\n /**\n * Tag expression to filter which scenarios can be retried\n * @default \"\"\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md}\n */\n retryTagFilter: string\n /**\n * Fail the test run if there are pending steps\n * @default true\n */\n strict: boolean\n /**\n * Tag expression to filter which scenarios should be run\n * @default \"\"\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#tags}\n */\n tags: string\n /**\n * Parameters to be passed to your World\n * @default \\{\\}\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/world.md}\n * @remarks\n * The value must be a JSON-serializable object.\n */\n worldParameters: JsonObject\n}\n\n/**\n * Collection of named configuration profiles\n * @public\n */\nexport type IProfiles = Record<string, Partial<IConfiguration>>\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate_configuration.js","sourceRoot":"","sources":["../../src/configuration/validate_configuration.ts"],"names":[],"mappings":";;AAGA,sDA+BC;AA/BD,SAAgB,qBAAqB,CACnC,aAA6B,EAC7B,MAAe;IAEf,IAAI,aAAa,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACxE,MAAM,CAAC,IAAI,CACT,wMAAwM,CACzM,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAChE,MAAM,CAAC,IAAI,CACT,+LAA+L,CAChM,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,aAAa,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC5D,MAAM,CAAC,IAAI,CACT,iGAAiG;YAC/F,wGAAwG;YACxG,4EAA4E,CAC/E,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,cAAc,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["import { ILogger } from '../environment'\nimport { IConfiguration } from './types'\n\nexport function validateConfiguration(\n configuration: IConfiguration,\n logger: ILogger\n): void {\n if (configuration.requireModule.length && !configuration.require.length) {\n logger.warn(\n 'Use of `require-module` option normally means you should specify your support code paths with `require`; see https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code'\n )\n }\n if (configuration.loader.length && !configuration.import.length) {\n logger.warn(\n 'Use of `loader` option normally means you should specify your support code paths with `import`; see https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code'\n )\n }\n if (configuration.formatOptions.colorsEnabled !== undefined) {\n logger.warn(\n `The 'colorsEnabled' format option is deprecated and will be removed in a future major version. ` +\n `Use the FORCE_COLOR environment variable instead (FORCE_COLOR=1 to enable, FORCE_COLOR=0 to disable); ` +\n `see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md`\n )\n }\n if (configuration.retryTagFilter && !configuration.retry) {\n throw new Error(\n 'a positive `retry` count must be specified when setting `retryTagFilter`'\n )\n }\n if (configuration.shard && !/^\\d+\\/\\d+$/.test(configuration.shard)) {\n throw new Error(\n 'the shard option must be in the format <index>/<total> (e.g. 1/3)'\n )\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"console_logger.js","sourceRoot":"","sources":["../../src/environment/console_logger.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AAItC,MAAa,aAAa;IAId;IACA;IAJO,OAAO,CAAS;IAEjC,YACU,MAAgB,EAChB,YAAqB;QADrB,WAAM,GAAN,MAAM,CAAU;QAChB,iBAAY,GAAZ,YAAY,CAAS;QAE7B,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC3C,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;IAChD,CAAC;IAED,IAAI,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;IAC/C,CAAC;CACF;AA3BD,sCA2BC","sourcesContent":["import { Console } from 'node:console'\nimport { Writable } from 'node:stream'\nimport { ILogger } from './types'\n\nexport class ConsoleLogger implements ILogger {\n private readonly console: Console\n\n constructor(\n private stream: Writable,\n private debugEnabled: boolean\n ) {\n this.console = new Console(this.stream)\n }\n\n debug(message?: any, ...optionalParams: any[]): void {\n if (this.debugEnabled) {\n this.console.debug(message, ...optionalParams)\n }\n }\n\n error(message?: any, ...optionalParams: any[]): void {\n this.console.error(message, ...optionalParams)\n }\n\n warn(message?: any, ...optionalParams: any[]): void {\n this.console.warn(message, ...optionalParams)\n }\n\n info(message?: any, ...optionalParams: any[]): void {\n this.console.info(message, ...optionalParams)\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,0CAAuB","sourcesContent":["export * from './make_environment'\nexport * from './types'\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"make_environment.js","sourceRoot":"","sources":["../../src/environment/make_environment.ts"],"names":[],"mappings":";;AAGA,0CAqBC;AAxBD,qDAAgD;AAGhD,SAAgB,eAAe,CAAC,QAAyB;IACvD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,EAAE,EACF;QACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,KAAK;KACb,EACD,QAAQ,CACT,CAAA;IACD,MAAM,MAAM,GAAG,IAAI,8BAAa,CAC9B,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,KAAK,CACtB,CAAA;IACD,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,eAAe,CAAC,CAAA;IACtD,OAAO;QACL,GAAG,eAAe;QAClB,MAAM,EAAE,MAAM;KACf,CAAA;AACH,CAAC","sourcesContent":["import { ConsoleLogger } from './console_logger'\nimport { UsableEnvironment, IRunEnvironment } from './types'\n\nexport function makeEnvironment(provided: IRunEnvironment): UsableEnvironment {\n const fullEnvironment = Object.assign(\n {},\n {\n cwd: process.cwd(),\n stdout: process.stdout,\n stderr: process.stderr,\n env: process.env,\n debug: false,\n },\n provided\n )\n const logger = new ConsoleLogger(\n fullEnvironment.stderr,\n fullEnvironment.debug\n )\n logger.debug('Resolved environment:', fullEnvironment)\n return {\n ...fullEnvironment,\n logger: logger,\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/environment/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Writable } from 'node:stream'\n\n/**\n * A logger that can be used to direct messages to stderr or similar\n * @public\n * @remarks\n * Matches the interface of Node.js Console, for the methods it has.\n */\nexport interface ILogger {\n debug: (message?: any, ...optionalParams: any[]) => void\n error: (message?: any, ...optionalParams: any[]) => void\n warn: (message?: any, ...optionalParams: any[]) => void\n info: (message?: any, ...optionalParams: any[]) => void\n}\n\n/**\n * Contextual data about the project environment\n * @public\n */\nexport interface IRunEnvironment {\n /**\n * Working directory for the project\n * @default process.cwd()\n */\n cwd?: string\n /**\n * Writable stream where the test run's main formatter output is written\n * @default process.stdout\n */\n stdout?: Writable\n /**\n * Writable stream where the test run's warning/error output is written\n * @default process.stderr\n */\n stderr?: Writable\n /**\n * Environment variables\n * @default process.env\n */\n env?: Record<string, string | undefined>\n /**\n * Whether debug logging should be emitted to {@link IRunEnvironment.stderr}\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/debugging.md}\n */\n debug?: boolean\n}\n\nexport type UsableEnvironment = Required<IRunEnvironment> & {\n logger: ILogger\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter_plugin.js","sourceRoot":"","sources":["../../src/filter/filter_plugin.ts"],"names":[],"mappings":";;;;;;AACA,qEAA2C;AAC3C,mDAA8C;AAEjC,QAAA,YAAY,GAAmB;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE;QACrE,IAAI,qBAAqB,GAAa,EAAE,CAAA;QACxC,EAAE,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;YAC5B,qBAAqB,GAAG,KAAK,CAAC,qBAAqB,CAAA;QACrD,CAAC,CAAC,CAAA;QAEF,SAAS,CAAC,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;YAC/C,MAAM,YAAY,GAAG,IAAI,uBAAY,CAAC;gBACpC,GAAG,EAAE,WAAW,CAAC,GAAG;gBACpB,YAAY,EAAE,qBAAqB;gBACnC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,aAAa,EAAE,OAAO,CAAC,aAAa;aACrC,CAAC,CAAA;YAEF,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;QAEF,SAAS,CAAC,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE;YACpD,MAAM,cAAc,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAA;YAC5C,IAAA,4BAAY,EAAC,cAAc,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACnD,OAAO,cAAc,CAAA;QACvB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { InternalPlugin } from '../plugin'\nimport PickleFilter from '../pickle_filter'\nimport { orderPickles } from './order_pickles'\n\nexport const filterPlugin: InternalPlugin = {\n type: 'plugin',\n coordinator: async ({ on, transform, options, logger, environment }) => {\n let unexpandedSourcePaths: string[] = []\n on('paths:resolve', (paths) => {\n unexpandedSourcePaths = paths.unexpandedSourcePaths\n })\n\n transform('pickles:filter', async (allPickles) => {\n const pickleFilter = new PickleFilter({\n cwd: environment.cwd,\n featurePaths: unexpandedSourcePaths,\n names: options.names,\n tagExpression: options.tagExpression,\n })\n\n return allPickles.filter((pickle) => pickleFilter.matches(pickle))\n })\n\n transform('pickles:order', async (unorderedPickles) => {\n const orderedPickles = [...unorderedPickles]\n orderPickles(orderedPickles, options.order, logger)\n return orderedPickles\n })\n },\n}\n"]}
|
package/lib/filter/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAA8C;AAC9C,0CAAuB;AACvB,iDAA8C;AAArC,6GAAA,YAAY,OAAA;AAErB,kBAAe,4BAAY,CAAA","sourcesContent":["import { filterPlugin } from './filter_plugin'\nexport * from './types'\nexport { orderPickles } from './order_pickles'\n\nexport default filterPlugin\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order_pickles.js","sourceRoot":"","sources":["../../src/filter/order_pickles.ts"],"names":[],"mappings":";;;;;AAKA,oCA0BC;AA/BD,gFAA0C;AAI1C,+CAA+C;AAC/C,SAAgB,YAAY,CAC1B,SAAc,EACd,KAAmB,EACnB,MAAe;IAEf,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACtC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,MAAK;QACP,KAAK,SAAS;YACZ,SAAS,CAAC,OAAO,EAAE,CAAA;YACnB,MAAK;QACP,KAAK,QAAQ;YACX,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAA;gBAClE,MAAM,CAAC,IAAI,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAA;gBAClD,IAAA,8BAAO,EAAC,SAAS,EAAE,OAAO,CAAC,CAAA;YAC7B,CAAC;iBAAM,CAAC;gBACN,IAAA,8BAAO,EAAC,SAAS,EAAE,IAAI,CAAC,CAAA;YAC1B,CAAC;YACD,MAAK;QACP;YACE,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAA;IACL,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import shuffle from 'knuth-shuffle-seeded'\nimport { ILogger } from '../environment'\nimport { IPickleOrder } from './types'\n\n// Orders the pickleIds in place - morphs input\nexport function orderPickles<T = string>(\n pickleIds: T[],\n order: IPickleOrder,\n logger: ILogger\n): void {\n const [type, seed] = splitOrder(order)\n switch (type) {\n case 'defined':\n break\n case 'reverse':\n pickleIds.reverse()\n break\n case 'random':\n if (seed === '') {\n const newSeed = Math.floor(Math.random() * 1000 * 1000).toString()\n logger.warn(`Random order using seed: ${newSeed}`)\n shuffle(pickleIds, newSeed)\n } else {\n shuffle(pickleIds, seed)\n }\n break\n default:\n throw new Error(\n 'Unrecognized order type. Should be `defined` or `random`'\n )\n }\n}\n\nfunction splitOrder(order: string) {\n if (!order.includes(':')) {\n return [order, '']\n }\n return order.split(':')\n}\n"]}
|
package/lib/filter/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/filter/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GherkinDocument, Location, Pickle } from '@cucumber/messages'\n\n/**\n * The ordering strategy for pickles\n * @public\n * @example \"defined\"\n * @example \"reverse\"\n * @example \"random\"\n * @example \"random:234119\"\n */\nexport type IPickleOrder = 'defined' | 'reverse' | 'random' | `random:${string}`\n\n/**\n * A Pickle decorated with relevant context that can be filtered or sorted\n * @public\n */\nexport interface IFilterablePickle {\n pickle: Pickle\n gherkinDocument: GherkinDocument\n location: Location\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter_stack_trace.js","sourceRoot":"","sources":["../src/filter_stack_trace.ts"],"names":[],"mappings":";;;;;AAOA,oDAIC;AAED,4CASC;AAtBD,0DAA4B;AAE5B,mDAAgD;AAEhD,MAAM,eAAe,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;AAClD,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAA;AAEvD,SAAgB,oBAAoB,CAAC,QAAgB;IACnD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACnC,QAAQ,CAAC,UAAU,CAAC,mBAAI,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,CACrD,CAAA;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAAoB;IACnD,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAA;IACf,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,OAAO,MAAM,CAAA;IACf,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAC/B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAoB;IAC7C,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9D,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1E,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAiB;IAC1C,MAAM,QAAQ,GAAG,IAAA,8BAAc,EAAC,KAAK,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAA;IACxD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAA;AACvC,CAAC;AAED,SAAS,aAAa,CAAC,KAAiB;IACtC,MAAM,QAAQ,GAAG,IAAA,8BAAc,EAAC,KAAK,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAA;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,mBAAI,CAAC,GAAG,CAAC,CAAA;AACrC,CAAC","sourcesContent":["import path from 'node:path'\nimport { StackFrame } from 'error-stack-parser'\nimport { valueOrDefault } from './value_checker'\n\nconst projectRootPath = path.join(__dirname, '..')\nconst projectChildDirs = ['src', 'lib', 'node_modules']\n\nexport function isFileNameInCucumber(fileName: string): boolean {\n return projectChildDirs.some((dir) =>\n fileName.startsWith(path.join(projectRootPath, dir))\n )\n}\n\nexport function filterStackTrace(frames: StackFrame[]): StackFrame[] {\n if (isErrorInCucumber(frames)) {\n return frames\n }\n const index = frames.findIndex((x) => isFrameInCucumber(x))\n if (index === -1) {\n return frames\n }\n return frames.slice(0, index)\n}\n\nfunction isErrorInCucumber(frames: StackFrame[]): boolean {\n const filteredFrames = frames.filter((x) => !isFrameInNode(x))\n return filteredFrames.length > 0 && isFrameInCucumber(filteredFrames[0])\n}\n\nfunction isFrameInCucumber(frame: StackFrame): boolean {\n const fileName = valueOrDefault(frame.getFileName(), '')\n return isFileNameInCucumber(fileName)\n}\n\nfunction isFrameInNode(frame: StackFrame): boolean {\n const fileName = valueOrDefault(frame.getFileName(), '')\n return !fileName.includes(path.sep)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/formatter/builder.ts"],"names":[],"mappings":";;;;;AAEA,oDAAkE;AAElE,qFAAmF;AAEnF,wGAA4E;AAC5E,4HAAiG;AACjG,oEAAyC;AACzC,sEAA6C;AAC7C,+CAA0C;AA0B1C,MAAM,gBAAgB,GAAG;IACvB,KAAK,CAAC,KAAK,CACT,oBAA+C,EAC/C,OAAsB;QAEtB,IAAI,OAAO,oBAAoB,KAAK,QAAQ,EAAE,CAAC;YAC7C,oBAAoB,GAAG,MAAM,gBAAgB,CAAC,oBAAoB,CAChE,oBAAoB,EACpB,OAAO,CAAC,GAAG,CACZ,CAAA;QACH,CAAC;QACD,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,GAAG,EACX,OAAO,CAAC,iBAAiB,CAAC,aAAa,CACxC,CAAA;QACD,MAAM,cAAc,GAClB,MAAM,gBAAgB,CAAC,+BAA+B,CAAC;YACrD,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,CAAC,gBAAgB;YAC5D,aAAa,EAAE,OAAO,CAAC,iBAAiB,CAAC,aAAa;YACtD,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;SAC/C,CAAC,CAAA;QACJ,OAAO,IAAI,oBAAoB,CAAC;YAC9B,QAAQ;YACR,cAAc;YACd,GAAG,OAAO;SACX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,IAAY,EACZ,GAAW;QAEX,MAAM,UAAU,GACd,oBAAU,CAAC,aAAa,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;IAC3C,CAAC;IAED,kBAAkB,CAAC,YAAiB;QAClC,IAAI,IAAA,gCAAgB,EAAC,YAAY,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE,CAAC;YACvC,OAAO,YAAY,CAAA;QACrB,CAAC;aAAM,IACL,OAAO,YAAY,KAAK,QAAQ;YAChC,OAAO,YAAY,CAAC,OAAO,KAAK,UAAU,EAC1C,CAAC;YACD,OAAO,YAAY,CAAC,OAAO,CAAA;QAC7B,CAAC;aAAM,IACL,OAAO,YAAY,CAAC,OAAO,KAAK,QAAQ;YACxC,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,KAAK,UAAU,EAClD,CAAC;YACD,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAA;QACrC,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AAED,kBAAe,gBAAgB,CAAA","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { Writable as WritableStream } from 'node:stream'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'\nimport EventDataCollector from './helpers/event_data_collector'\nimport StepDefinitionSnippetBuilder from './step_definition_snippet_builder'\nimport JavascriptSnippetSyntax from './step_definition_snippet_builder/javascript_snippet_syntax'\nimport getColorFns from './get_color_fns'\nimport Formatters from './helpers/formatters'\nimport { importCode } from './import_code'\nimport Formatter, {\n FormatOptions,\n IFormatterCleanupFn,\n IFormatterLogFn,\n} from '.'\n\ninterface IGetStepDefinitionSnippetBuilderOptions {\n cwd: string\n snippetInterface?: SnippetInterface\n snippetSyntax?: string\n supportCodeLibrary: SupportCodeLibrary\n}\n\nexport interface IBuildOptions {\n env: NodeJS.ProcessEnv\n cwd: string\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n log: IFormatterLogFn\n parsedArgvOptions: FormatOptions\n stream: WritableStream\n cleanup: IFormatterCleanupFn\n supportCodeLibrary: SupportCodeLibrary\n}\n\nconst FormatterBuilder = {\n async build(\n FormatterConstructor: string | typeof Formatter,\n options: IBuildOptions\n ): Promise<Formatter> {\n if (typeof FormatterConstructor === 'string') {\n FormatterConstructor = await FormatterBuilder.getConstructorByType(\n FormatterConstructor,\n options.cwd\n )\n }\n const colorFns = getColorFns(\n options.stream,\n options.env,\n options.parsedArgvOptions.colorsEnabled\n )\n const snippetBuilder =\n await FormatterBuilder.getStepDefinitionSnippetBuilder({\n cwd: options.cwd,\n snippetInterface: options.parsedArgvOptions.snippetInterface,\n snippetSyntax: options.parsedArgvOptions.snippetSyntax,\n supportCodeLibrary: options.supportCodeLibrary,\n })\n return new FormatterConstructor({\n colorFns,\n snippetBuilder,\n ...options,\n })\n },\n\n async getConstructorByType(\n type: string,\n cwd: string\n ): Promise<typeof Formatter> {\n const formatters: Record<string, typeof Formatter> =\n Formatters.getFormatters()\n\n return formatters[type]\n ? formatters[type]\n : await FormatterBuilder.loadCustomClass('formatter', type, cwd)\n },\n\n async getStepDefinitionSnippetBuilder({\n cwd,\n snippetInterface,\n snippetSyntax,\n supportCodeLibrary,\n }: IGetStepDefinitionSnippetBuilderOptions) {\n if (doesNotHaveValue(snippetInterface)) {\n snippetInterface = SnippetInterface.Synchronous\n }\n let Syntax = JavascriptSnippetSyntax\n if (doesHaveValue(snippetSyntax)) {\n Syntax = await FormatterBuilder.loadCustomClass(\n 'syntax',\n snippetSyntax,\n cwd\n )\n }\n return new StepDefinitionSnippetBuilder({\n snippetSyntax: new Syntax(snippetInterface),\n parameterTypeRegistry: supportCodeLibrary.parameterTypeRegistry,\n })\n },\n\n async loadCustomClass(\n type: 'formatter' | 'syntax',\n descriptor: string,\n cwd: string\n ) {\n const CustomClass = FormatterBuilder.resolveConstructor(\n await importCode(descriptor, cwd)\n )\n if (doesHaveValue(CustomClass)) {\n return CustomClass\n } else {\n throw new Error(\n `Custom ${type} (${descriptor}) does not export a function/class`\n )\n }\n },\n\n async loadFile(urlOrName: URL | string) {\n return await import(urlOrName.toString())\n },\n\n resolveConstructor(ImportedCode: any) {\n if (doesNotHaveValue(ImportedCode)) {\n return null\n }\n if (typeof ImportedCode === 'function') {\n return ImportedCode\n } else if (\n typeof ImportedCode === 'object' &&\n typeof ImportedCode.default === 'function'\n ) {\n return ImportedCode.default\n } else if (\n typeof ImportedCode.default === 'object' &&\n typeof ImportedCode.default.default === 'function'\n ) {\n return ImportedCode.default.default\n }\n return null\n },\n}\n\nexport default FormatterBuilder\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../../src/formatter/builtin/html.ts"],"names":[],"mappings":";;AAAA,yCAAqC;AACrC,6CAAsC;AACtC,6DAA6D;AAC7D,+DAAyE;AAOzE,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;QACzC,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAA;QACH,CAAC;QACD,MAAM,iBAAiB,GAAG,IAAI,+CAA6B,CAAC;YAC1D,SAAS,EAAE,OAAO,CAAC,mBAAmB;YACtC,SAAS;SACV,CAAC,CAAA;QACF,MAAM,UAAU,GAAG,IAAI,mCAAkB,EAAE,CAAA;QAC3C,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAClC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YACxB,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;QACF,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;QAE9C,OAAO,KAAK,IAAI,EAAE;YAChB,iBAAiB,CAAC,GAAG,EAAE,CAAA;YACvB,MAAM,IAAA,qBAAS,EAAC,sBAAQ,CAAC,CAAC,UAAU,CAAC,CAAA;QACvC,CAAC,CAAA;IACH,CAAC;IACD,UAAU,EAAE,MAAM;CACgB,CAAA","sourcesContent":["import { promisify } from 'node:util'\nimport { finished } from 'node:stream'\nimport { CucumberHtmlStream } from '@cucumber/html-formatter'\nimport { AttachmentExternalisingStream } from '@cucumber/message-streams'\nimport { FormatterPlugin } from '../../plugin'\n\ninterface Options {\n externalAttachments?: boolean | ReadonlyArray<string>\n}\n\nexport default {\n type: 'formatter',\n formatter({ on, options, write, directory }) {\n if (!directory && options.externalAttachments) {\n throw new Error(\n 'Unable to externalise attachments when formatter is not writing to a file'\n )\n }\n const externaliseStream = new AttachmentExternalisingStream({\n behaviour: options.externalAttachments,\n directory,\n })\n const htmlStream = new CucumberHtmlStream()\n externaliseStream.pipe(htmlStream)\n on('message', (message) => {\n externaliseStream.write(message)\n })\n htmlStream.on('data', (chunk) => write(chunk))\n\n return async () => {\n externaliseStream.end()\n await promisify(finished)(htmlStream)\n }\n },\n optionsKey: 'html',\n} satisfies FormatterPlugin<Options>\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatter/builtin/index.ts"],"names":[],"mappings":";;;;;;AACA,uEAA6C;AAC7C,+EAAqD;AACrD,uFAA4D;AAC5D,yEAA+C;AAC/C,+EAAqD;AACrD,6EAAmD;AACnD,yEAA+C;AAC/C,mFAAwD;AACxD,wDAAwC;AACxC,kDAAkC;AAElC,MAAM,OAAO,GAAG;IACd,8BAA8B;IAC9B,IAAI,EAAE,cAAa;IACnB,KAAK,EAAE,+BAA+B;IACtC,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,iBAAgB;IACzB,gCAAgC;IAChC,IAAI,EAAE,wBAAa;IACnB,QAAQ,EAAE,4BAAiB;IAC3B,cAAc,EAAE,gCAAoB;IACpC,KAAK,EAAE,yBAAc;IACrB,QAAQ,EAAE,4BAAiB;IAC3B,OAAO,EAAE,2BAAgB;IACzB,KAAK,EAAE,yBAAc;IACrB,YAAY,EAAE,8BAAkB;CACmC,CAAA;AAErE,kBAAe,OAA2D,CAAA;AAE7D,QAAA,aAAa,GAAG;IAC3B,8BAA8B;IAC9B,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,6BAA6B;IACpC,MAAM,EACJ,0EAA0E;IAC5E,OAAO,EAAE,mDAAmD;IAC5D,gCAAgC;IAChC,IAAI,EAAE,wBAAa,CAAC,aAAa;IACjC,QAAQ,EAAE,4BAAiB,CAAC,aAAa;IACzC,cAAc,EAAE,gCAAoB,CAAC,aAAa;IAClD,KAAK,EAAE,yBAAc,CAAC,aAAa;IACnC,QAAQ,EAAE,4BAAiB,CAAC,aAAa;IACzC,OAAO,EAAE,2BAAgB,CAAC,aAAa;IACvC,KAAK,EAAE,yBAAc,CAAC,aAAa;IACnC,YAAY,EAAE,8BAAkB,CAAC,aAAa;CACA,CAAA","sourcesContent":["import { FormatterImplementation } from '../index'\nimport JsonFormatter from '../json_formatter'\nimport ProgressFormatter from '../progress_formatter'\nimport ProgressBarFormatter from '../progress_bar_formatter'\nimport RerunFormatter from '../rerun_formatter'\nimport SnippetsFormatter from '../snippets_formatter'\nimport SummaryFormatter from '../summary_formatter'\nimport UsageFormatter from '../usage_formatter'\nimport UsageJsonFormatter from '../usage_json_formatter'\nimport messageFormatter from './message'\nimport htmlFormatter from './html'\n\nconst builtin = {\n // new plugin-based formatters\n html: htmlFormatter,\n junit: '@cucumber/junit-xml-formatter',\n pretty: '@cucumber/pretty-formatter',\n message: messageFormatter,\n // legacy class-based formatters\n json: JsonFormatter,\n progress: ProgressFormatter,\n 'progress-bar': ProgressBarFormatter,\n rerun: RerunFormatter,\n snippets: SnippetsFormatter,\n summary: SummaryFormatter,\n usage: UsageFormatter,\n 'usage-json': UsageJsonFormatter,\n} as const satisfies Record<string, FormatterImplementation | string>\n\nexport default builtin as Record<string, FormatterImplementation | string>\n\nexport const documentation = {\n // new plugin-based formatters\n html: 'Outputs a HTML report',\n junit: 'Produces a JUnit XML report',\n pretty:\n 'Writes a rich report of the scenario and example execution as it happens',\n message: 'Emits Cucumber messages in newline-delimited JSON',\n // legacy class-based formatters\n json: JsonFormatter.documentation,\n progress: ProgressFormatter.documentation,\n 'progress-bar': ProgressBarFormatter.documentation,\n rerun: RerunFormatter.documentation,\n snippets: SnippetsFormatter.documentation,\n summary: SummaryFormatter.documentation,\n usage: UsageFormatter.documentation,\n 'usage-json': UsageJsonFormatter.documentation,\n} satisfies Record<keyof typeof builtin, string>\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/formatter/builtin/message.ts"],"names":[],"mappings":";;AAEA,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE;QACrB,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;IACnE,CAAC;CACwB,CAAA","sourcesContent":["import { FormatterPlugin } from '../../plugin'\n\nexport default {\n type: 'formatter',\n formatter({ on, write }) {\n on('message', (message) => write(JSON.stringify(message) + '\\n'))\n },\n} satisfies FormatterPlugin\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create_stream.js","sourceRoot":"","sources":["../../src/formatter/create_stream.ts"],"names":[],"mappings":";;;;;AAMA,oCA4BC;AAlCD,0DAA4B;AAE5B,mCAA+B;AAC/B,+CAAsB;AAGf,KAAK,UAAU,YAAY,CAChC,MAAc,EACd,aAAyB,EACzB,GAAW,EACX,MAAe;IAEf,MAAM,cAAc,GAAG,mBAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IAE9C,IAAI,CAAC;QACH,MAAM,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;IACzB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,wDAAwD,EAAE,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,MAAM,MAAM,GAAa,YAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE;QAClD,EAAE,EAAE,MAAM,YAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC;KACvC,CAAC,CAAA;IAEF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;QAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC3B,aAAa,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,SAAS;QACT,MAAM;KACP,CAAA;AACH,CAAC","sourcesContent":["import path from 'node:path'\nimport { Writable } from 'node:stream'\nimport { mkdirp } from 'mkdirp'\nimport fs from 'mz/fs'\nimport { ILogger } from '../environment'\n\nexport async function createStream(\n target: string,\n onStreamError: () => void,\n cwd: string,\n logger: ILogger\n) {\n const absoluteTarget = path.resolve(cwd, target)\n const directory = path.dirname(absoluteTarget)\n\n try {\n await mkdirp(directory)\n } catch (e) {\n logger.warn('Failed to ensure directory for formatter target exists', e)\n }\n\n const stream: Writable = fs.createWriteStream(null, {\n fd: await fs.open(absoluteTarget, 'w'),\n })\n\n stream.on('error', (error: Error) => {\n logger.error(error.message)\n onStreamError()\n })\n\n return {\n directory,\n stream,\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find_class_or_plugin.js","sourceRoot":"","sources":["../../src/formatter/find_class_or_plugin.ts"],"names":[],"mappings":";;AAEA,8CAEC;AAJD,oDAAmD;AAEnD,SAAgB,iBAAiB,CAAC,QAAa;IAC7C,OAAO,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;AACnC,CAAC;AAED,SAAS,aAAa,CAAC,KAAU,EAAE,KAAa;IAC9C,IAAI,IAAA,gCAAgB,EAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC5D,OAAO,KAAK,CAAA;IACd,CAAC;IACD,KAAK,EAAE,CAAA;IACP,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC5C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { doesNotHaveValue } from '../value_checker'\n\nexport function findClassOrPlugin(imported: any) {\n return findRecursive(imported, 3)\n}\n\nfunction findRecursive(thing: any, depth: number): any {\n if (doesNotHaveValue(thing)) {\n return null\n }\n if (typeof thing === 'function') {\n return thing\n }\n if (typeof thing === 'object' && thing.type === 'formatter') {\n return thing\n }\n depth--\n if (depth > 0) {\n return findRecursive(thing.default, depth)\n }\n return null\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_color_fns.js","sourceRoot":"","sources":["../../src/formatter/get_color_fns.ts"],"names":[],"mappings":";;;;;AAkBA,8BAwCC;AAzDD,kDAAyB;AACzB,mDAAyD;AAEzD,oDAAmD;AAcnD,SAAwB,WAAW,CACjC,MAAgB,EAChB,GAAsB,EACtB,OAAiB;IAEjB,MAAM,OAAO,GAAc,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;IAC9D,IAAI,OAAO,EAAE,CAAC;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AClB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACb,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnB,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACrB,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACtB,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SACrB,CAAA;IACH,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CACpB,MAAgB,EAChB,GAAsB,EACtB,OAAiB;IAEjB,MAAM,OAAO,GAAc,IAAA,8BAAa,EAAC,MAAM,CAAC,CAAA;IAChD,4EAA4E;IAC5E,IAAI,aAAa,IAAI,GAAG,IAAI,IAAA,gCAAgB,EAAC,OAAO,CAAC,EAAE,CAAC;QACtD,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;AAClD,CAAC","sourcesContent":["import { Writable } from 'node:stream'\nimport chalk from 'chalk'\nimport { ColorInfo, supportsColor } from 'supports-color'\nimport { TestStepResultStatus } from '@cucumber/messages'\nimport { doesNotHaveValue } from '../value_checker'\n\nexport type IColorFn = (text: string) => string\n\nexport interface IColorFns {\n forStatus: (status: TestStepResultStatus) => IColorFn\n location: IColorFn\n tag: IColorFn\n diffAdded: IColorFn\n diffRemoved: IColorFn\n errorMessage: IColorFn\n errorStack: IColorFn\n}\n\nexport default function getColorFns(\n stream: Writable,\n env: NodeJS.ProcessEnv,\n enabled?: boolean\n): IColorFns {\n const support: ColorInfo = detectSupport(stream, env, enabled)\n if (support) {\n const chalkInstance = new chalk.Instance(support)\n return {\n forStatus(status: TestStepResultStatus) {\n return {\n AMBIGUOUS: chalkInstance.red.bind(chalk),\n FAILED: chalkInstance.red.bind(chalk),\n PASSED: chalkInstance.green.bind(chalk),\n PENDING: chalkInstance.yellow.bind(chalk),\n SKIPPED: chalkInstance.cyan.bind(chalk),\n UNDEFINED: chalkInstance.yellow.bind(chalk),\n UNKNOWN: chalkInstance.yellow.bind(chalk),\n }[status]\n },\n location: chalkInstance.gray.bind(chalk),\n tag: chalkInstance.cyan.bind(chalk),\n diffAdded: chalkInstance.green.bind(chalk),\n diffRemoved: chalkInstance.red.bind(chalk),\n errorMessage: chalkInstance.red.bind(chalk),\n errorStack: chalkInstance.grey.bind(chalk),\n }\n } else {\n return {\n forStatus(_status: TestStepResultStatus) {\n return (x) => x\n },\n location: (x) => x,\n tag: (x) => x,\n diffAdded: (x) => x,\n diffRemoved: (x) => x,\n errorMessage: (x) => x,\n errorStack: (x) => x,\n }\n }\n}\n\nfunction detectSupport(\n stream: Writable,\n env: NodeJS.ProcessEnv,\n enabled?: boolean\n): ColorInfo {\n const support: ColorInfo = supportsColor(stream)\n // if we find FORCE_COLOR, we can let the supports-color library handle that\n if ('FORCE_COLOR' in env || doesNotHaveValue(enabled)) {\n return support\n }\n return enabled ? support || { level: 1 } : false\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duration_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/duration_helpers.ts"],"names":[],"mappings":";;AAIA,sDAEC;AAJD,MAAM,eAAe,GAAG,aAAa,CAAA;AAErC,SAAgB,qBAAqB,CAAC,QAAkB;IACtD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,GAAG,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;AACxE,CAAC","sourcesContent":["import { Duration } from '@cucumber/messages'\n\nconst NANOS_IN_SECOND = 1_000_000_000\n\nexport function durationToNanoseconds(duration: Duration): number {\n return Math.floor(duration.seconds * NANOS_IN_SECOND + duration.nanos)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event_data_collector.js","sourceRoot":"","sources":["../../../src/formatter/help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UAAU,EACV,cAAc,GACY;QAC1B,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;YACpE,cAAc,CAAA;IAClB,CAAC;IAED,mBAAmB,CAAC,EAClB,iBAAiB,EACjB,aAAa,GACa;QAC1B,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAC/B,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,WAAW,CAC3D,CAAA;QACD,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,mBAAmB;YAChE,QAAQ,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAA;QAC9C,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,aAAa,GAAG,aAAa,CAAA;IAC9E,CAAC;CACF;AA3GD,qCA2GC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport * as messages from '@cucumber/messages'\nimport { doesHaveValue, doesNotHaveValue } from '../../value_checker'\n\ninterface ITestCaseAttemptData {\n attempt: number\n willBeRetried: boolean\n testCaseId: string\n stepAttachments: Record<string, messages.Attachment[]>\n stepResults: Record<string, messages.TestStepResult>\n worstTestStepResult: messages.TestStepResult\n}\n\nexport interface ITestCaseAttempt {\n attempt: number\n willBeRetried: boolean\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n stepAttachments: Record<string, messages.Attachment[]>\n stepResults: Record<string, messages.TestStepResult>\n testCase: messages.TestCase\n worstTestStepResult: messages.TestStepResult\n}\n\nexport default class EventDataCollector {\n private gherkinDocumentMap: Record<string, messages.GherkinDocument> = {}\n private pickleMap: Record<string, messages.Pickle> = {}\n private testCaseMap: Record<string, messages.TestCase> = {}\n private testCaseAttemptDataMap: Record<string, ITestCaseAttemptData> = {}\n readonly undefinedParameterTypes: messages.UndefinedParameterType[] = []\n\n constructor(eventBroadcaster: EventEmitter) {\n eventBroadcaster.on('envelope', this.parseEnvelope.bind(this))\n }\n\n getGherkinDocument(uri: string): messages.GherkinDocument {\n return this.gherkinDocumentMap[uri]\n }\n\n getPickle(pickleId: string): messages.Pickle {\n return this.pickleMap[pickleId]\n }\n\n getTestCaseAttempts(): ITestCaseAttempt[] {\n return Object.keys(this.testCaseAttemptDataMap).map((testCaseStartedId) => {\n return this.getTestCaseAttempt(testCaseStartedId)\n })\n }\n\n getTestCaseAttempt(testCaseStartedId: string): ITestCaseAttempt {\n const testCaseAttemptData = this.testCaseAttemptDataMap[testCaseStartedId]\n const testCase = this.testCaseMap[testCaseAttemptData.testCaseId]\n const pickle = this.pickleMap[testCase.pickleId]\n return {\n gherkinDocument: this.gherkinDocumentMap[pickle.uri],\n pickle,\n testCase,\n attempt: testCaseAttemptData.attempt,\n willBeRetried: testCaseAttemptData.willBeRetried,\n stepAttachments: testCaseAttemptData.stepAttachments,\n stepResults: testCaseAttemptData.stepResults,\n worstTestStepResult: testCaseAttemptData.worstTestStepResult,\n }\n }\n\n parseEnvelope(envelope: messages.Envelope): void {\n if (doesHaveValue(envelope.gherkinDocument)) {\n this.gherkinDocumentMap[envelope.gherkinDocument.uri] =\n envelope.gherkinDocument\n } else if (doesHaveValue(envelope.pickle)) {\n this.pickleMap[envelope.pickle.id] = envelope.pickle\n } else if (doesHaveValue(envelope.undefinedParameterType)) {\n this.undefinedParameterTypes.push(envelope.undefinedParameterType)\n } else if (doesHaveValue(envelope.testCase)) {\n this.testCaseMap[envelope.testCase.id] = envelope.testCase\n } else if (doesHaveValue(envelope.testCaseStarted)) {\n this.initTestCaseAttempt(envelope.testCaseStarted)\n } else if (doesHaveValue(envelope.attachment)) {\n this.storeAttachment(envelope.attachment)\n } else if (doesHaveValue(envelope.testStepFinished)) {\n this.storeTestStepResult(envelope.testStepFinished)\n } else if (doesHaveValue(envelope.testCaseFinished)) {\n this.storeTestCaseResult(envelope.testCaseFinished)\n }\n }\n\n private initTestCaseAttempt(testCaseStarted: messages.TestCaseStarted): void {\n this.testCaseAttemptDataMap[testCaseStarted.id] = {\n attempt: testCaseStarted.attempt,\n willBeRetried: false,\n testCaseId: testCaseStarted.testCaseId,\n stepAttachments: {},\n stepResults: {},\n worstTestStepResult: {\n duration: { seconds: 0, nanos: 0 },\n status: messages.TestStepResultStatus.UNKNOWN,\n },\n }\n }\n\n storeAttachment(attachment: messages.Attachment): void {\n const { testCaseStartedId, testStepId } = attachment\n if (doesHaveValue(testCaseStartedId) && doesHaveValue(testStepId)) {\n const { stepAttachments } = this.testCaseAttemptDataMap[testCaseStartedId]\n if (doesNotHaveValue(stepAttachments[testStepId])) {\n stepAttachments[testStepId] = []\n }\n stepAttachments[testStepId].push(attachment)\n }\n }\n\n storeTestStepResult({\n testCaseStartedId,\n testStepId,\n testStepResult,\n }: messages.TestStepFinished): void {\n this.testCaseAttemptDataMap[testCaseStartedId].stepResults[testStepId] =\n testStepResult\n }\n\n storeTestCaseResult({\n testCaseStartedId,\n willBeRetried,\n }: messages.TestCaseFinished): void {\n const stepResults = Object.values(\n this.testCaseAttemptDataMap[testCaseStartedId].stepResults\n )\n this.testCaseAttemptDataMap[testCaseStartedId].worstTestStepResult =\n messages.getWorstTestStepResult(stepResults)\n this.testCaseAttemptDataMap[testCaseStartedId].willBeRetried = willBeRetried\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/formatter/helpers/formatters.ts"],"names":[],"mappings":";;;;;AACA,uEAA6C;AAC7C,uFAA4D;AAC5D,+EAAqD;AACrD,yEAA+C;AAC/C,+EAAqD;AACrD,6EAAmD;AACnD,yEAA+C;AAC/C,mFAAwD;AAExD,MAAM,UAAU,GAAG;IACjB,aAAa;QACX,OAAO;YACL,IAAI,EAAE,wBAAa;YACnB,QAAQ,EAAE,4BAAiB;YAC3B,cAAc,EAAE,gCAAoB;YACpC,KAAK,EAAE,yBAAc;YACrB,QAAQ,EAAE,4BAAiB;YAC3B,OAAO,EAAE,2BAAgB;YACzB,KAAK,EAAE,yBAAc;YACrB,YAAY,EAAE,8BAAkB;SACjC,CAAA;IACH,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import Formatter from '../.'\nimport JsonFormatter from '../json_formatter'\nimport ProgressBarFormatter from '../progress_bar_formatter'\nimport ProgressFormatter from '../progress_formatter'\nimport RerunFormatter from '../rerun_formatter'\nimport SnippetsFormatter from '../snippets_formatter'\nimport SummaryFormatter from '../summary_formatter'\nimport UsageFormatter from '../usage_formatter'\nimport UsageJsonFormatter from '../usage_json_formatter'\n\nconst Formatters = {\n getFormatters(): Record<string, typeof Formatter> {\n return {\n json: JsonFormatter,\n progress: ProgressFormatter,\n 'progress-bar': ProgressBarFormatter,\n rerun: RerunFormatter,\n snippets: SnippetsFormatter,\n summary: SummaryFormatter,\n usage: UsageFormatter,\n 'usage-json': UsageJsonFormatter,\n }\n },\n}\n\nexport default Formatters\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gherkin_document_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/gherkin_document_parser.ts"],"names":[],"mappings":";;AAGA,8CAWC;AAiBD,sDAkBC;AAED,4DAYC;AAED,sEAkBC;AAlFD,uDAAmD;AAEnD,SAAgB,iBAAiB,CAC/B,eAAyC;IAEzC,MAAM,MAAM,GAAkC,EAAE,CAAA;IAChD,eAAe,CAAC,OAAO,CAAC,QAAQ;SAC7B,GAAG,CAAC,qBAAqB,CAAC;SAC1B,IAAI,EAAE;SACN,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAmB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CACnE,CAAA;IACH,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,qBAAqB,CAC5B,KAA4B;IAE5B,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC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AAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,IAAI,CAAC,QAAQ;SACZ,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,6BAAa,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SAChD,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAC5D,CAAA;IACH,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,6BAA6B,CAC3C,eAAyC;IAEzC,MAAM,WAAW,GAAsC,EAAE,CAAA;IACzD,MAAM,WAAW,GACf,qBAAqB,CAAC,eAAe,CAAC,CAAA;IACxC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACtC,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;QAChC,WAAW,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAA;QACnC,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAC9B,CAAC,CAAC,SAAS,CAAC,OAAO,CACjB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAC7D,CACF,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IACF,OAAO,WAAW,CAAA;AACpB,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../../value_checker'\n\nexport function getGherkinStepMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Step> {\n const result: Record<string, messages.Step> = {}\n gherkinDocument.feature.children\n .map(extractStepContainers)\n .flat()\n .forEach((x) =>\n x.steps.forEach((step: messages.Step) => (result[step.id] = step))\n )\n return result\n}\n\nfunction extractStepContainers(\n child: messages.FeatureChild\n): Array<messages.Scenario | messages.Background> {\n if (doesHaveValue(child.background)) {\n return [child.background]\n } else if (doesHaveValue(child.rule)) {\n return child.rule.children.map((ruleChild) =>\n doesHaveValue(ruleChild.background)\n ? ruleChild.background\n : ruleChild.scenario\n )\n }\n return [child.scenario]\n}\n\nexport function getGherkinScenarioMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Scenario> {\n const result: Record<string, messages.Scenario> = {}\n gherkinDocument.feature.children\n .map((child: messages.FeatureChild) => {\n if (doesHaveValue(child.rule)) {\n return child.rule.children\n }\n return [child]\n })\n .flat()\n .forEach((x) => {\n if (x.scenario != null) {\n result[x.scenario.id] = x.scenario\n }\n })\n return result\n}\n\nexport function getGherkinExampleRuleMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Rule> {\n const result: Record<string, messages.Rule> = {}\n gherkinDocument.feature.children\n .filter((x) => x.rule != null)\n .forEach((x) =>\n x.rule.children\n .filter((child) => doesHaveValue(child.scenario))\n .forEach((child) => (result[child.scenario.id] = x.rule))\n )\n return result\n}\n\nexport function getGherkinScenarioLocationMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Location> {\n const locationMap: Record<string, messages.Location> = {}\n const scenarioMap: Record<string, messages.Scenario> =\n getGherkinScenarioMap(gherkinDocument)\n Object.keys(scenarioMap).forEach((id) => {\n const scenario = scenarioMap[id]\n locationMap[id] = scenario.location\n if (doesHaveValue(scenario.examples)) {\n scenario.examples.forEach((x) =>\n x.tableBody.forEach(\n (tableRow) => (locationMap[tableRow.id] = tableRow.location)\n )\n )\n }\n })\n return locationMap\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatter/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAAkE;AAUzD,sDAAqB;AAT9B,8DAA+C;AASf,oCAAY;AAP5C,uEAAiE;AAAxD,gIAAA,oBAAoB,OAAA;AAC7B,+DAAsE;AAA7D,2IAAA,OAAO,OAAsB;AACtC,+CAAgE;AAAvD,2GAAA,WAAW,OAAA;AAAE,kHAAA,kBAAkB,OAAA;AACxC,iDAA4E;AAAnE,4GAAA,WAAW,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,wGAAA,OAAO,OAAA;AACnD,uDAAmD;AAA1C,kHAAA,cAAc,OAAA;AACvB,qDAAiD;AAAxC,gHAAA,aAAa,OAAA;AACtB,iDAA0C;AAAjC,yGAAA,QAAQ,OAAA","sourcesContent":["import * as GherkinDocumentParser from './gherkin_document_parser'\nimport * as PickleParser from './pickle_parser'\n\nexport { parseTestCaseAttempt } from './test_case_attempt_parser'\nexport { default as EventDataCollector } from './event_data_collector'\nexport { KeywordType, getStepKeywordType } from './keyword_type'\nexport { formatIssue, isWarning, isFailure, isIssue } from './issue_helpers'\nexport { formatLocation } from './location_helpers'\nexport { formatSummary } from './summary_helpers'\nexport { getUsage } from './usage_helpers'\nexport { GherkinDocumentParser, PickleParser }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"issue_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/issue_helpers.ts"],"names":[],"mappings":";;;;;AAQA,8BASC;AAED,8BAOC;AAED,0BAEC;AAWD,kCAwBC;AAED,sEAiBC;AAED,oEAIC;AA1FD,kEAAwC;AAKxC,+EAAqE;AAGrE,SAAgB,SAAS,CACvB,MAA+B,EAC/B,gBAAyB,KAAK;IAE9B,OAAO,CACL,MAAM,CAAC,MAAM,KAAK,WAAW;QAC7B,MAAM,CAAC,MAAM,KAAK,WAAW;QAC7B,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,aAAa,CAAC,CA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AAE;QAChD,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAA;IAChD,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;SACtB,GAAG,CACF,CAAC,aAAa,EAAE,EAAE,CAAC,KAAK,4BAA4B,CAAC,aAAa,CAAC,EAAE,CACtE;SACA,IAAI,CAAC,IAAI,CAAC,CACd,CAAA;IACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACnB,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxB,CAAC;AAED,SAAgB,4BAA4B,CAC1C,aAA8C;IAE9C,OAAO,IAAI,aAAa,CAAC,IAAI,YAAY,aAAa,CAAC,UAAU,IAAI,CAAA;AACvE,CAAC","sourcesContent":["import indentString from 'indent-string'\nimport * as messages from '@cucumber/messages'\nimport { IColorFns } from '../get_color_fns'\nimport StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { formatTestCaseAttempt } from './test_case_attempt_formatter'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nexport function isFailure(\n result: messages.TestStepResult,\n willBeRetried: boolean = false\n): boolean {\n return (\n result.status === 'AMBIGUOUS' ||\n result.status === 'UNDEFINED' ||\n (result.status === 'FAILED' && !willBeRetried)\n )\n}\n\nexport function isWarning(\n result: messages.TestStepResult,\n willBeRetried: boolean = false\n): boolean {\n return (\n result.status === 'PENDING' || (result.status === 'FAILED' && willBeRetried)\n )\n}\n\nexport function isIssue(result: messages.TestStepResult): boolean {\n return isFailure(result) || isWarning(result)\n}\n\nexport interface IFormatIssueRequest {\n colorFns: IColorFns\n number: number\n snippetBuilder: StepDefinitionSnippetBuilder\n testCaseAttempt: ITestCaseAttempt\n supportCodeLibrary: SupportCodeLibrary\n printAttachments?: boolean\n}\n\nexport function formatIssue({\n colorFns,\n number,\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n printAttachments = true,\n}: IFormatIssueRequest): string {\n const prefix = `${number.toString()}) `\n const formattedTestCaseAttempt = formatTestCaseAttempt({\n colorFns,\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n printAttachments,\n })\n const lines = formattedTestCaseAttempt.split('\\n')\n const updatedLines = lines.map((line, index) => {\n if (index === 0) {\n return `${prefix}${line}`\n }\n return indentString(line, prefix.length)\n })\n return updatedLines.join('\\n')\n}\n\nexport function formatUndefinedParameterTypes(\n undefinedParameterTypes: messages.UndefinedParameterType[]\n): string {\n const output = [`Undefined parameter types:\\n\\n`]\n const withLatest: Record<string, messages.UndefinedParameterType> = {}\n undefinedParameterTypes.forEach((parameterType) => {\n withLatest[parameterType.name] = parameterType\n })\n output.push(\n Object.values(withLatest)\n .map(\n (parameterType) => `- ${formatUndefinedParameterType(parameterType)}`\n )\n .join('\\n')\n )\n output.push('\\n\\n')\n return output.join('')\n}\n\nexport function formatUndefinedParameterType(\n parameterType: messages.UndefinedParameterType\n): string {\n return `\"${parameterType.name}\" e.g. \\`${parameterType.expression}\\``\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyword_type.js","sourceRoot":"","sources":["../../../src/formatter/helpers/keyword_type.ts"],"names":[],"mappings":";;;AAeA,gDAsBC;AArCD,+CAAqD;AACrD,uDAAmD;AAEnD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4CAA6B,CAAA;IAC7B,8BAAe,CAAA;IACf,kCAAmB,CAAA;AACrB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAQD,SAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,mBAAmB,GACQ;IAC3B,MAAM,OAAO,GAAY,kBAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3C,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IACrE,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;IACvE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,KAAK,CAAA;QAC1B,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,OAAO,CAAA;QAC5B,KAAK,KAAK,CAAC;QACX,KAAK,KAAK;YACR,IAAI,IAAA,6BAAa,EAAC,mBAAmB,CAAC,EAAE,CAAC;gBACvC,OAAO,mBAAmB,CAAA;YAC5B,CAAC;QACH,cAAc;QACd;YACE,OAAO,WAAW,CAAC,YAAY,CAAA;IACnC,CAAC;AACH,CAAC","sourcesContent":["import { Dialect, dialects } from '@cucumber/gherkin'\nimport { doesHaveValue } from '../../value_checker'\n\nexport enum KeywordType {\n Precondition = 'precondition',\n Event = 'event',\n Outcome = 'outcome',\n}\n\nexport interface IGetStepKeywordTypeOptions {\n keyword: string\n language: string\n previousKeywordType?: KeywordType\n}\n\nexport function getStepKeywordType({\n keyword,\n language,\n previousKeywordType,\n}: IGetStepKeywordTypeOptions): KeywordType {\n const dialect: Dialect = dialects[language]\n const stepKeywords = ['given', 'when', 'then', 'and', 'but'] as const\n const type = stepKeywords.find((key) => dialect[key].includes(keyword))\n switch (type) {\n case 'when':\n return KeywordType.Event\n case 'then':\n return KeywordType.Outcome\n case 'and':\n case 'but':\n if (doesHaveValue(previousKeywordType)) {\n return previousKeywordType\n }\n // fallthrough\n default:\n return KeywordType.Precondition\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/location_helpers.ts"],"names":[],"mappings":";;;;;AAIA,wCAMC;AAVD,0DAA4B;AAC5B,uDAAmD;AAGnD,SAAgB,cAAc,CAAC,GAAgB,EAAE,GAAY;IAC3D,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;IACjB,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,EAAE,CAAC;QACvB,GAAG,GAAG,mBAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC/B,CAAC;IACD,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAA;AACxC,CAAC","sourcesContent":["import path from 'node:path'\nimport { doesHaveValue } from '../../value_checker'\nimport { ILineAndUri } from '../../types'\n\nexport function formatLocation(obj: ILineAndUri, cwd?: string): string {\n let uri = obj.uri\n if (doesHaveValue(cwd)) {\n uri = path.relative(cwd, uri)\n }\n return `${uri}:${obj.line.toString()}`\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pickle_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/pickle_parser.ts"],"names":[],"mappings":";;AAkBA,wDAOC;AAED,wCAOC;AAED,4CAMC;AAED,8CASC;AApDD,uEAAyE;AAiBzE,SAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,kBAAkB,GACa;IAC/B,OAAO,MAAM,CAAC,UAAU;SACrB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;SACnC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;AAC5C,CAAC;AAED,SAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,cAAc,GACS;IACvB,OAAO,UAAU,CAAC,UAAU;SACzB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;SAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;AACxC,CAAC;AAED,SAAgB,gBAAgB,CAC9B,MAAuB;IAEvB,MAAM,MAAM,GAAwC,EAAE,CAAA;IACtD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAA;IAC1E,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,iBAAiB,CAAC,EAChC,eAAe,EACf,MAAM,GACoB;IAC1B,MAAM,0BAA0B,GAC9B,IAAA,uDAA6B,EAAC,eAAe,CAAC,CAAA;IAChD,OAAO,0BAA0B,CAC/B,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAChD,CAAA;AACH,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { getGherkinScenarioLocationMap } from './gherkin_document_parser'\n\nexport interface IGetPickleLocationRequest {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n}\n\nexport interface IGetStepKeywordRequest {\n pickleStep: messages.PickleStep\n gherkinStepMap: Record<string, messages.Step>\n}\n\nexport interface IGetScenarioDescriptionRequest {\n pickle: messages.Pickle\n gherkinScenarioMap: Record<string, messages.Scenario>\n}\n\nexport function getScenarioDescription({\n pickle,\n gherkinScenarioMap,\n}: IGetScenarioDescriptionRequest): string {\n return pickle.astNodeIds\n .map((id) => gherkinScenarioMap[id])\n .filter((x) => x != null)[0].description\n}\n\nexport function getStepKeyword({\n pickleStep,\n gherkinStepMap,\n}: IGetStepKeywordRequest): string {\n return pickleStep.astNodeIds\n .map((id) => gherkinStepMap[id])\n .filter((x) => x != null)[0].keyword\n}\n\nexport function getPickleStepMap(\n pickle: messages.Pickle\n): Record<string, messages.PickleStep> {\n const result: Record<string, messages.PickleStep> = {}\n pickle.steps.forEach((pickleStep) => (result[pickleStep.id] = pickleStep))\n return result\n}\n\nexport function getPickleLocation({\n gherkinDocument,\n pickle,\n}: IGetPickleLocationRequest): messages.Location {\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n return gherkinScenarioLocationMap[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ]\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"step_argument_formatter.js","sourceRoot":"","sources":["../../../src/formatter/helpers/step_argument_formatter.ts"],"names":[],"mappings":";;;;;AA0CA,gDAKC;AA/CD,4DAA8B;AAE9B,yDAAwD;AAExD,SAAS,eAAe,CAAC,SAA+B;IACtD,MAAM,KAAK,GAAG,IAAI,oBAAK,CAAC;QACtB,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,aAAa,EAAE,EAAE;YACjB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,IAAI,EAAE,GAAG;YACT,UAAU,EAAE,EAAE;YACd,GAAG,EAAE,EAAE;YACP,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;YACV,WAAW,EAAE,EAAE;YACf,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;SAChB;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,CAAC;SACnB;KACF,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACtC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CACxD,CACF,CAAA;IACD,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;IACnB,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;AACzB,CAAC;AAED,SAAS,eAAe,CAAC,SAAmC;IAC1D,OAAO,QAAQ,SAAS,CAAC,OAAO,OAAO,CAAA;AACzC,CAAC;AAED,SAAgB,kBAAkB,CAAC,GAAgC;IACjE,OAAO,IAAA,kCAAiB,EAAC,GAAG,EAAE;QAC5B,SAAS,EAAE,eAAe;QAC1B,SAAS,EAAE,eAAe;KAC3B,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import Table from 'cli-table3'\nimport * as messages from '@cucumber/messages'\nimport { parseStepArgument } from '../../step_arguments'\n\nfunction formatDataTable(dataTable: messages.PickleTable): string {\n const table = new Table({\n chars: {\n bottom: '',\n 'bottom-left': '',\n 'bottom-mid': '',\n 'bottom-right': '',\n left: '|',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n middle: '|',\n right: '|',\n 'right-mid': '',\n top: '',\n 'top-left': '',\n 'top-mid': '',\n 'top-right': '',\n },\n style: {\n border: [],\n 'padding-left': 1,\n 'padding-right': 1,\n },\n })\n const rows = dataTable.rows.map((row) =>\n row.cells.map((cell) =>\n cell.value.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\\\n')\n )\n )\n table.push(...rows)\n return table.toString()\n}\n\nfunction formatDocString(docString: messages.PickleDocString): string {\n return `\"\"\"\\n${docString.content}\\n\"\"\"`\n}\n\nexport function formatStepArgument(arg: messages.PickleStepArgument): string {\n return parseStepArgument(arg, {\n dataTable: formatDataTable,\n docString: formatDocString,\n })\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summary_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/summary_helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,sCAwCC;AA9DD,6DAA8C;AAC9C,iCAAgC;AAEhC,uDAAmD;AAGnD,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,CAAC,oBAAoB,CAAC,MAAM;IACp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AAC;gBACvB,OAAO,CAAC,IAAI,CACV,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CACxB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CACvD,CACF,CAAA;YACH,CAAC;QACH,CAAC,CAAC,CAAA;QACF,IAAI,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAA;IACpC,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,kBAAkB,CAAC,WAA8B;IACxD,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAA;IACzB,MAAM,GAAG,GAAG,IAAI,IAAI,CAClB,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAC5D,CAAA;IACD,MAAM,QAAQ,GAAG,gBAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC;QAC7D,SAAS;QACT,SAAS;QACT,cAAc;KACf,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;AAC3C,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { Interval } from 'luxon'\nimport { IColorFns } from '../get_color_fns'\nimport { doesHaveValue } from '../../value_checker'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nconst STATUS_REPORT_ORDER = [\n messages.TestStepResultStatus.FAILED,\n messages.TestStepResultStatus.AMBIGUOUS,\n messages.TestStepResultStatus.UNDEFINED,\n messages.TestStepResultStatus.PENDING,\n messages.TestStepResultStatus.SKIPPED,\n messages.TestStepResultStatus.PASSED,\n messages.TestStepResultStatus.UNKNOWN,\n]\n\nexport interface IFormatSummaryRequest {\n colorFns: IColorFns\n testCaseAttempts: ITestCaseAttempt[]\n testRunDuration: messages.Duration\n}\n\nexport function formatSummary({\n colorFns,\n testCaseAttempts,\n testRunDuration,\n}: IFormatSummaryRequest): string {\n const testCaseResults: messages.TestStepResult[] = []\n const testStepResults: messages.TestStepResult[] = []\n let totalStepDuration = messages.TimeConversion.millisecondsToDuration(0)\n testCaseAttempts.forEach(\n ({ testCase, willBeRetried, worstTestStepResult, stepResults }) => {\n Object.values(stepResults).forEach((stepResult) => {\n totalStepDuration = messages.TimeConversion.addDurations(\n totalStepDuration,\n stepResult.duration\n )\n })\n if (!willBeRetried) {\n testCaseResults.push(worstTestStepResult)\n testCase.testSteps.forEach((testStep) => {\n if (doesHaveValue(testStep.pickleStepId)) {\n testStepResults.push(stepResults[testStep.id])\n }\n })\n }\n }\n )\n const scenarioSummary = getCountSummary({\n colorFns,\n objects: testCaseResults,\n type: 'scenario',\n })\n const stepSummary = getCountSummary({\n colorFns,\n objects: testStepResults,\n type: 'step',\n })\n const durationSummary = `${getDurationSummary(\n testRunDuration\n )} (executing steps: ${getDurationSummary(totalStepDuration)})\\n`\n return [scenarioSummary, stepSummary, durationSummary].join('\\n')\n}\n\ninterface IGetCountSummaryRequest {\n colorFns: IColorFns\n objects: messages.TestStepResult[]\n type: string\n}\n\nfunction getCountSummary({\n colorFns,\n objects,\n type,\n}: IGetCountSummaryRequest): string {\n const counts: Record<string, number> = {}\n STATUS_REPORT_ORDER.forEach((x) => (counts[x] = 0))\n objects.forEach((x) => (counts[x.status] += 1))\n const total = Object.values(counts).reduce((acc, x) => acc + x, 0)\n let text = `${total.toString()} ${type}${total === 1 ? '' : 's'}`\n if (total > 0) {\n const details: string[] = []\n STATUS_REPORT_ORDER.forEach((status) => {\n if (counts[status] > 0) {\n details.push(\n colorFns.forStatus(status)(\n `${counts[status].toString()} ${status.toLowerCase()}`\n )\n )\n }\n })\n text += ` (${details.join(', ')})`\n }\n return text\n}\n\nfunction getDurationSummary(durationMsg: messages.Duration): string {\n const start = new Date(0)\n const end = new Date(\n messages.TimeConversion.durationToMilliseconds(durationMsg)\n )\n const duration = Interval.fromDateTimes(start, end).toDuration([\n 'minutes',\n 'seconds',\n 'milliseconds',\n ])\n return duration.toFormat(\"m'm'ss.SSS's'\")\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test_case_attempt_formatter.js","sourceRoot":"","sources":["../../../src/formatter/helpers/test_case_attempt_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,sDAqBC;AArHD,kEAAwC;AACxC,6DAA8C;AAC9C,sDAA6B;AAE7B,uDAAmE;AAGnE,yDAAmD;AACnD,yEAGmC;AACnC,uEAA8D;AAG9D,MAAM,UAAU,GAA+C,IAAI,GAAG,CAAC;IACrE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,SAAS,EAAE,iBAAO,CAAC,KAAK,CAAC;IACxD,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,iBAAO,CAAC,KAAK,CAAC;IACrD,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,iBAAO,CAAC,IAAI,CAAC;IACpD,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC;IAC5C,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC;IAC5C,CAAC,QAAQ,CAAC,oBAAoB,CAAC,SAAS,EAAE,GAAG,CAAC;CAC/C,CAAC,CAAA;AAEF,SAAS,cAAc,CAAC,QAAyB;IAC/C,QAAQ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAC/B,KAAK,QAAQ,CAAC,oBAAoB,CAAC,SAAS,CAAC;QAC7C,KAAK,QAAQ,CAAC,oBAAoB,CAAC,MAAM;YACvC,OAAO,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAA;QAChC,KAAK,QAAQ,CAAC,oBAAoB,CAAC,SAAS;YAC1C,OAAO,GACL,kDAAkD,GAAG,MACvD,GAAG,IAAA,uBAAY,EAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,IAA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,QAAQ,EAAE,EAAE;QACpC,IAAI,IAAI,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAA;IACF,OAAO,GAAG,IAAI,IAAI,CAAA;AACpB,CAAC;AAED,SAAS,cAAc,CAAC,OAAe,EAAE,aAAsB;IAC7D,IAAI,OAAO,GAAG,CAAC,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;QAC1C,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAA;QACnD,OAAO,aAAa,SAAS,GAAG,UAAU,GAAG,CAAA;IAC/C,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import indentString from 'indent-string'\nimport * as messages from '@cucumber/messages'\nimport figures from 'figures'\nimport { IColorFns } from '../get_color_fns'\nimport { doesHaveValue, valueOrDefault } from '../../value_checker'\nimport StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { formatLocation } from './location_helpers'\nimport {\n IParsedTestStep,\n parseTestCaseAttempt,\n} from './test_case_attempt_parser'\nimport { formatStepArgument } from './step_argument_formatter'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nconst CHARACTERS: Map<messages.TestStepResultStatus, string> = new Map([\n [messages.TestStepResultStatus.AMBIGUOUS, figures.cross],\n [messages.TestStepResultStatus.FAILED, figures.cross],\n [messages.TestStepResultStatus.PASSED, figures.tick],\n [messages.TestStepResultStatus.PENDING, '?'],\n [messages.TestStepResultStatus.SKIPPED, '-'],\n [messages.TestStepResultStatus.UNDEFINED, '?'],\n])\n\nfunction getStepMessage(testStep: IParsedTestStep): string {\n switch (testStep.result.status) {\n case messages.TestStepResultStatus.AMBIGUOUS:\n case messages.TestStepResultStatus.FAILED:\n return testStep.result.message\n case messages.TestStepResultStatus.UNDEFINED:\n return `${\n 'Undefined. Implement with the following snippet:' + '\\n\\n'\n }${indentString(testStep.snippet, 2)}\\n`\n case messages.TestStepResultStatus.PENDING:\n return 'Pending'\n }\n return ''\n}\n\ninterface IFormatStepRequest {\n colorFns: IColorFns\n testStep: IParsedTestStep\n printAttachments?: boolean\n}\n\nfunction formatStep({\n colorFns,\n testStep,\n printAttachments,\n}: IFormatStepRequest): string {\n const {\n name,\n result: { status },\n actionLocation,\n attachments,\n } = testStep\n const colorFn = colorFns.forStatus(status)\n const identifier = testStep.keyword + valueOrDefault(testStep.text, '')\n let text = colorFn(`${CHARACTERS.get(status)} ${identifier}`)\n if (doesHaveValue(name)) {\n text += colorFn(` (${name})`)\n }\n if (doesHaveValue(actionLocation)) {\n text += ` # ${colorFns.location(formatLocation(actionLocation))}`\n }\n text += '\\n'\n if (doesHaveValue(testStep.argument)) {\n const argumentsText = formatStepArgument(testStep.argument)\n text += indentString(`${colorFn(argumentsText)}\\n`, 4)\n }\n if (valueOrDefault(printAttachments, true)) {\n attachments.forEach(({ body, mediaType, fileName }) => {\n let message = ''\n if (mediaType === 'text/plain') {\n message = `: ${body}`\n } else if (fileName) {\n message = `: ${fileName}`\n }\n text += indentString(`Attachment (${mediaType})${message}\\n`, 4)\n })\n }\n const message = getStepMessage(testStep)\n if (message !== '') {\n text += `${indentString(colorFn(message), 4)}\\n`\n }\n return text\n}\n\nexport interface IFormatTestCaseAttemptRequest {\n colorFns: IColorFns\n testCaseAttempt: ITestCaseAttempt\n snippetBuilder: StepDefinitionSnippetBuilder\n supportCodeLibrary: SupportCodeLibrary\n printAttachments?: boolean\n}\n\nexport function formatTestCaseAttempt({\n colorFns,\n snippetBuilder,\n supportCodeLibrary,\n testCaseAttempt,\n printAttachments,\n}: IFormatTestCaseAttemptRequest): string {\n const parsed = parseTestCaseAttempt({\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n })\n let text = `Scenario: ${parsed.testCase.name}`\n text += getAttemptText(parsed.testCase.attempt, testCaseAttempt.willBeRetried)\n text += ` # ${colorFns.location(\n formatLocation(parsed.testCase.sourceLocation)\n )}\\n`\n parsed.testSteps.forEach((testStep) => {\n text += formatStep({ colorFns, testStep, printAttachments })\n })\n return `${text}\\n`\n}\n\nfunction getAttemptText(attempt: number, willBeRetried: boolean): string {\n if (attempt > 0 || willBeRetried) {\n const numberStr = (attempt + 1).toString()\n const retriedStr = willBeRetried ? ', retried' : ''\n return ` (attempt ${numberStr}${retriedStr})`\n }\n return ''\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test_case_attempt_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/test_case_attempt_parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA,oDAiEC;AAjMD,6DAA8C;AAC9C,iDAAmD;AAGnD,uDAAmE;AAGnE,iDAAgE;AAChE,uEAGkC;AAClC,mDAAkE;AAyClE,SAAS,SAAS,CAAC,EACjB,YAAY,EACZ,cAAc,EACd,OAAO,EACP,WAAW,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,mBAAmB,GACD;IAClB,MAAM,GAAG,GAAoB;QAC3B,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,IAAA,6BAAa,EAAC,QAAQ,CAAC,YAAY,CAAC;YAC3C,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,YAAY;gBACZ,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,OAAO;QACb,MAAM,EAAE,cAAc;KACvB,CAAA;IACD,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,IAAI,cAAsC,CAAA;QAC1C,IAAI,YAAY,EAAE,CAAC;YACjB,cAAc,GAAG,kBAAkB,CAAC,6BAA6B,CAAC,IAAI,CACpE,CAAC,CAAC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CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,yBAAc,EAAE,CAAA;QAElE,YAAY,GAAG,YAAY,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAE7D,IAAI,OAAO,EAAE,WAAW,EAAE,UAAU,CAAA;QACpC,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACzC,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;YACjD,OAAO,GAAG,IAAA,8BAAc,EAAC,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAA;YACxD,WAAW,GAAG,IAAA,iCAAkB,EAAC;gBAC/B,OAAO;gBACP,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC,QAAQ;gBAC1C,mBAAmB;aACpB,CAAC,CAAA;QACJ,CAAC;QACD,MAAM,UAAU,GAAG,SAAS,CAAC;YAC3B,YAAY;YACZ,cAAc;YACd,OAAO;YACP,WAAW;YACX,UAAU;YACV,SAAS,EAAE,iBAAiB;YAC5B,cAAc;YACd,kBAAkB;YAClB,QAAQ;YACR,cAAc;YACd,mBAAmB,EAAE,IAAA,8BAAc,EACjC,eAAe,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,EAC5C,EAAE,CACH;SACF,CAAC,CAAA;QACF,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAChC,mBAAmB,GAAG,WAAW,CAAA;IACnC,CAAC,CAAC,CAAA;IACF,OAAO;QACL,QAAQ,EAAE,cAAc;QACxB,SAAS,EAAE,eAAe;KAC3B,CAAA;AACH,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { TestStepResult } from '@cucumber/messages'\nimport StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { doesHaveValue, valueOrDefault } from '../../value_checker'\nimport TestCaseHookDefinition from '../../models/test_case_hook_definition'\nimport { ILineAndUri } from '../../types'\nimport { getStepKeywordType, KeywordType } from './keyword_type'\nimport {\n getGherkinScenarioLocationMap,\n getGherkinStepMap,\n} from './gherkin_document_parser'\nimport { getPickleStepMap, getStepKeyword } from './pickle_parser'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nexport interface IParsedTestStep {\n actionLocation?: ILineAndUri\n argument?: messages.PickleStepArgument\n attachments: messages.Attachment[]\n keyword: string\n name?: string\n result: messages.TestStepResult\n snippet?: string\n sourceLocation?: ILineAndUri\n text?: string\n}\n\nexport interface IParsedTestCase {\n attempt: number\n name: string\n sourceLocation?: ILineAndUri\n worstTestStepResult: messages.TestStepResult\n}\n\nexport interface IParsedTestCaseAttempt {\n testCase: IParsedTestCase\n testSteps: IParsedTestStep[]\n}\n\ninterface IParseStepRequest {\n isBeforeHook: boolean\n gherkinStepMap: Record<string, messages.Step>\n keyword: string\n keywordType: KeywordType\n pickleStep: messages.PickleStep\n pickleUri: string\n snippetBuilder: StepDefinitionSnippetBuilder\n supportCodeLibrary: SupportCodeLibrary\n testStep: messages.TestStep\n testStepResult: messages.TestStepResult\n testStepAttachments: messages.Attachment[]\n}\n\nfunction parseStep({\n isBeforeHook,\n gherkinStepMap,\n keyword,\n keywordType,\n pickleStep,\n pickleUri,\n snippetBuilder,\n supportCodeLibrary,\n testStep,\n testStepResult,\n testStepAttachments,\n}: IParseStepRequest): IParsedTestStep {\n const out: IParsedTestStep = {\n attachments: testStepAttachments,\n keyword: doesHaveValue(testStep.pickleStepId)\n ? keyword\n : isBeforeHook\n ? 'Before'\n : 'After',\n result: testStepResult,\n }\n if (doesHaveValue(testStep.hookId)) {\n let hookDefinition: TestCaseHookDefinition\n if (isBeforeHook) {\n hookDefinition = supportCodeLibrary.beforeTestCaseHookDefinitions.find(\n (x) => x.id === testStep.hookId\n )\n } else {\n hookDefinition = supportCodeLibrary.afterTestCaseHookDefinitions.find(\n (x) => x.id === testStep.hookId\n )\n }\n out.actionLocation = {\n uri: hookDefinition.uri,\n line: hookDefinition.line,\n }\n out.name = hookDefinition.name\n }\n if (\n doesHaveValue(testStep.stepDefinitionIds) &&\n testStep.stepDefinitionIds.length === 1\n ) {\n const stepDefinition = supportCodeLibrary.stepDefinitions.find(\n (x) => x.id === testStep.stepDefinitionIds[0]\n )\n out.actionLocation = {\n uri: stepDefinition.uri,\n line: stepDefinition.line,\n }\n }\n if (doesHaveValue(testStep.pickleStepId)) {\n out.sourceLocation = {\n uri: pickleUri,\n line: gherkinStepMap[pickleStep.astNodeIds[0]].location.line,\n }\n out.text = pickleStep.text\n if (doesHaveValue(pickleStep.argument)) {\n out.argument = pickleStep.argument\n }\n }\n if (testStepResult.status === messages.TestStepResultStatus.UNDEFINED) {\n out.snippet = snippetBuilder.build({ keywordType, pickleStep })\n }\n return out\n}\n\nexport interface IParseTestCaseAttemptRequest {\n testCaseAttempt: ITestCaseAttempt\n snippetBuilder: StepDefinitionSnippetBuilder\n supportCodeLibrary: SupportCodeLibrary\n}\n\n// Converts a testCaseAttempt into a json object with all data needed for\n// displaying it in a pretty format\nexport function parseTestCaseAttempt({\n testCaseAttempt,\n snippetBuilder,\n supportCodeLibrary,\n}: IParseTestCaseAttemptRequest): IParsedTestCaseAttempt {\n const { testCase, pickle, gherkinDocument } = testCaseAttempt\n const gherkinStepMap = getGherkinStepMap(gherkinDocument)\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n const pickleStepMap = getPickleStepMap(pickle)\n const relativePickleUri = pickle.uri\n const parsedTestCase: IParsedTestCase = {\n attempt: testCaseAttempt.attempt,\n name: pickle.name,\n sourceLocation: {\n uri: relativePickleUri,\n line: gherkinScenarioLocationMap[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ].line,\n },\n worstTestStepResult: testCaseAttempt.worstTestStepResult,\n }\n const parsedTestSteps: IParsedTestStep[] = []\n let isBeforeHook = true\n let previousKeywordType = KeywordType.Precondition\n\n testCase.testSteps.forEach((testStep) => {\n const testStepResult =\n testCaseAttempt.stepResults[testStep.id] || new TestStepResult()\n\n isBeforeHook = isBeforeHook && doesHaveValue(testStep.hookId)\n\n let keyword, keywordType, pickleStep\n if (doesHaveValue(testStep.pickleStepId)) {\n pickleStep = pickleStepMap[testStep.pickleStepId]\n keyword = getStepKeyword({ pickleStep, gherkinStepMap })\n keywordType = getStepKeywordType({\n keyword,\n language: gherkinDocument.feature.language,\n previousKeywordType,\n })\n }\n const parsedStep = parseStep({\n isBeforeHook,\n gherkinStepMap,\n keyword,\n keywordType,\n pickleStep,\n pickleUri: relativePickleUri,\n snippetBuilder,\n supportCodeLibrary,\n testStep,\n testStepResult,\n testStepAttachments: valueOrDefault(\n testCaseAttempt.stepAttachments[testStep.id],\n []\n ),\n })\n parsedTestSteps.push(parsedStep)\n previousKeywordType = keywordType\n })\n return {\n testCase: parsedTestCase,\n testSteps: parsedTestSteps,\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/formatter/helpers/usage_helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4HA,4BAMC;AAlID,6DAA8C;AAC9C,oDAAmD;AACnD,wEAA8D;AAE9D,0DAAsD;AAyBtD,SAAS,iBAAiB,CACxB,eAAiC;IAEjC,MAAM,OAAO,GAA2B,EAAE,CAAA;IAC1C,eAAe,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;QACzC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG;YAC3B,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC,QAAQ,EAAE;YAC7C,IAAI,EAAE,cAAc,CAAC,IAAI;YACzB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,MAAM;YACzC,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI;YACvD,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,cAAc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Q,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QACtE,CAAC,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,CAAA;QAClD,MAAM,SAAS,GAAwB,OAAO;aAC3C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QACzB,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CACxC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC,CAAC,EACnE,CAAC,CACF,CAAA;YACD,MAAM,CAAC,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAClE,iBAAiB,GAAG,SAAS,CAAC,MAAM,CACrC,CAAA;QACH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC,CAAC;SACD,IAAI,CACH,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CACvB,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CACxE,CAAA;AACL,CAAC;AAED,SAAgB,QAAQ,CAAC,EACvB,eAAe,EACf,kBAAkB,GACD;IACjB,MAAM,OAAO,GAAG,YAAY,CAAC,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC,CAAA;IACrE,OAAO,WAAW,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { getPickleStepMap } from '../pickle_parser'\nimport { getGherkinStepMap } from '../gherkin_document_parser'\nimport StepDefinition from '../../../models/step_definition'\nimport { doesHaveValue } from '../../../value_checker'\nimport EventDataCollector from '../event_data_collector'\n\nexport interface IUsageMatch {\n duration?: messages.Duration\n line: number\n text: string\n uri: string\n}\n\nexport interface IUsage {\n code: string\n line: number\n matches: IUsageMatch[]\n meanDuration?: messages.Duration\n pattern: string\n patternType: string\n uri: string\n}\n\nexport interface IGetUsageRequest {\n eventDataCollector: EventDataCollector\n stepDefinitions: StepDefinition[]\n}\n\nfunction buildEmptyMapping(\n stepDefinitions: StepDefinition[]\n): Record<string, IUsage> {\n const mapping: Record<string, IUsage> = {}\n stepDefinitions.forEach((stepDefinition) => {\n mapping[stepDefinition.id] = {\n code: stepDefinition.unwrappedCode.toString(),\n line: stepDefinition.line,\n pattern: stepDefinition.expression.source,\n patternType: stepDefinition.expression.constructor.name,\n matches: [],\n uri: stepDefinition.uri,\n }\n })\n return mapping\n}\n\nconst unexecutedStatuses: readonly messages.TestStepResultStatus[] = [\n messages.TestStepResultStatus.AMBIGUOUS,\n messages.TestStepResultStatus.SKIPPED,\n messages.TestStepResultStatus.UNDEFINED,\n]\n\nfunction buildMapping({\n stepDefinitions,\n eventDataCollector,\n}: IGetUsageRequest): Record<string, IUsage> {\n const mapping = buildEmptyMapping(stepDefinitions)\n eventDataCollector.getTestCaseAttempts().forEach((testCaseAttempt) => {\n const pickleStepMap = getPickleStepMap(testCaseAttempt.pickle)\n const gherkinStepMap = getGherkinStepMap(testCaseAttempt.gherkinDocument)\n testCaseAttempt.testCase.testSteps.forEach((testStep) => {\n if (\n doesHaveValue(testStep.pickleStepId) &&\n testStep.stepDefinitionIds.length === 1\n ) {\n const stepDefinitionId = testStep.stepDefinitionIds[0]\n const pickleStep = pickleStepMap[testStep.pickleStepId]\n const gherkinStep = gherkinStepMap[pickleStep.astNodeIds[0]]\n const match: IUsageMatch = {\n line: gherkinStep.location.line,\n text: pickleStep.text,\n uri: testCaseAttempt.pickle.uri,\n }\n const { duration, status } = testCaseAttempt.stepResults[testStep.id]\n if (!unexecutedStatuses.includes(status) && doesHaveValue(duration)) {\n match.duration = duration\n }\n if (doesHaveValue(mapping[stepDefinitionId])) {\n mapping[stepDefinitionId].matches.push(match)\n }\n }\n })\n })\n return mapping\n}\n\nfunction normalizeDuration(duration?: messages.Duration): number {\n if (duration == null) {\n return Number.MIN_SAFE_INTEGER\n }\n return messages.TimeConversion.durationToMilliseconds(duration)\n}\n\nfunction buildResult(mapping: Record<string, IUsage>): IUsage[] {\n return Object.keys(mapping)\n .map((stepDefinitionId) => {\n const { matches, ...rest } = mapping[stepDefinitionId]\n const sortedMatches = matches.sort((a: IUsageMatch, b: IUsageMatch) => {\n if (a.duration === b.duration) {\n return a.text < b.text ? -1 : 1\n }\n return normalizeDuration(b.duration) - normalizeDuration(a.duration)\n })\n const result = { matches: sortedMatches, ...rest }\n const durations: messages.Duration[] = matches\n .filter((m) => m.duration != null)\n .map((m) => m.duration)\n if (durations.length > 0) {\n const totalMilliseconds = durations.reduce(\n (acc, x) => acc + messages.TimeConversion.durationToMilliseconds(x),\n 0\n )\n result.meanDuration = messages.TimeConversion.millisecondsToDuration(\n totalMilliseconds / durations.length\n )\n }\n return result\n })\n .sort(\n (a: IUsage, b: IUsage) =>\n normalizeDuration(b.meanDuration) - normalizeDuration(a.meanDuration)\n )\n}\n\nexport function getUsage({\n stepDefinitions,\n eventDataCollector,\n}: IGetUsageRequest): IUsage[] {\n const mapping = buildMapping({ stepDefinitions, eventDataCollector })\n return buildResult(mapping)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import_code.js","sourceRoot":"","sources":["../../src/formatter/import_code.ts"],"names":[],"mappings":";;;;;AAGA,gCAcC;AAjBD,uCAAwC;AACxC,0DAA4B;AAErB,KAAK,UAAU,UAAU,CAAC,SAAiB,EAAE,GAAW;IAC7D,IAAI,CAAC;QACH,IAAI,UAAU,GAAiB,SAAS,CAAA;QACxC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,UAAU,GAAG,IAAA,wBAAa,EAAC,mBAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAA;QAC1D,CAAC;aAAM,IAAI,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3C,UAAU,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAA;QACjC,CAAC;QACD,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8BAA8B,SAAS,EAAE,EAAE;YACzD,KAAK,EAAE,CAAC;SACT,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { pathToFileURL } from 'node:url'\nimport path from 'node:path'\n\nexport async function importCode(specifier: string, cwd: string): Promise<any> {\n try {\n let normalized: URL | string = specifier\n if (specifier.startsWith('.')) {\n normalized = pathToFileURL(path.resolve(cwd, specifier))\n } else if (specifier.startsWith('file://')) {\n normalized = new URL(specifier)\n }\n return await import(normalized.toString())\n } catch (e) {\n throw new Error(`Failed to import formatter ${specifier}`, {\n cause: e,\n })\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formatter/index.ts"],"names":[],"mappings":";;AAGA,oDAAiD;AA4CjD,MAAqB,SAAS;IAClB,QAAQ,CAAW;IACnB,GAAG,CAAQ;IACX,kBAAkB,CAAoB;IACtC,GAAG,CAAiB;IACpB,cAAc,CAA8B;IAC5C,MAAM,CAAU;IAChB,kBAAkB,CAAoB;IACtC,gBAAgB,CAAS;IAClB,OAAO,CAAqB;IAC7C,MAAM,CAAU,aAAa,CAAQ;IAErC,YAAY,OAA0B;QACpC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QAChC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACtB,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;QACpD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACtB,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAA;QAC5C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;QAC5B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC9B,IAAI,CAAC,gBAAgB,GAAG,IAAA,8BAAc,EACpC,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,EAC1C,IAAI,CACL,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;IACtB,CAAC;CACF;AA9BD,4BA8BC","sourcesContent":["import { Writable } from 'node:stream'\nimport { EventEmitter } from 'node:events'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { valueOrDefault } from '../value_checker'\nimport { FormatterPlugin } from '../plugin'\nimport { IColorFns } from './get_color_fns'\nimport { EventDataCollector } from './helpers'\nimport StepDefinitionSnippetBuilder from './step_definition_snippet_builder'\nimport { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'\n\nexport interface FormatRerunOptions {\n separator?: string\n}\n\nexport interface FormatOptions {\n /**\n * @deprecated use `FORCE_COLOR` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md\n */\n colorsEnabled?: boolean\n html?: {\n externalAttachments?: boolean | ReadonlyArray<string>\n }\n rerun?: FormatRerunOptions\n snippetInterface?: SnippetInterface\n snippetSyntax?: string\n printAttachments?: boolean\n [customKey: string]: any\n}\n\nexport type FormatterImplementation = typeof Formatter | FormatterPlugin\nexport type IFormatterStream = Writable\nexport type IFormatterLogFn = (buffer: string | Uint8Array) => void\nexport type IFormatterCleanupFn = () => Promise<any>\n\nexport interface IFormatterOptions {\n colorFns: IColorFns\n cwd: string\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n log: IFormatterLogFn\n parsedArgvOptions: FormatOptions\n snippetBuilder: StepDefinitionSnippetBuilder\n stream: Writable\n cleanup: IFormatterCleanupFn\n supportCodeLibrary: SupportCodeLibrary\n}\n\nexport default class Formatter {\n protected colorFns: IColorFns\n protected cwd: string\n protected eventDataCollector: EventDataCollector\n protected log: IFormatterLogFn\n protected snippetBuilder: StepDefinitionSnippetBuilder\n protected stream: Writable\n protected supportCodeLibrary: SupportCodeLibrary\n protected printAttachments: boolean\n private readonly cleanup: IFormatterCleanupFn\n static readonly documentation: string\n\n constructor(options: IFormatterOptions) {\n this.colorFns = options.colorFns\n this.cwd = options.cwd\n this.eventDataCollector = options.eventDataCollector\n this.log = options.log\n this.snippetBuilder = options.snippetBuilder\n this.stream = options.stream\n this.supportCodeLibrary = options.supportCodeLibrary\n this.cleanup = options.cleanup\n this.printAttachments = valueOrDefault(\n options.parsedArgvOptions.printAttachments,\n true\n )\n }\n\n async finished(): Promise<void> {\n await this.cleanup()\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json_formatter.js","sourceRoot":"","sources":["../../src/formatter/json_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA8C;AAC9C,oDAAkE;AAClE,sDAAqD;AACrD,uCAA+E;AAC/E,+EAG0C;AAE1C,iEAAkE;AAClE,0CAAiD;AAEjD,MAAM,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,GAAG,+BAAqB,CAAA;AAE1E,MAAM,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAChE,sBAAY,CAAA;AAoEd,MAAqB,aAAc,SAAQ,UAAS;IAC3C,MAAM,CAAU,aAAa,GAClC,kMAAkM,CAAA;IAEpM,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;Q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;IACL,CAAC;IAED,eAAe,CAAC,EACd,OAAO,EACP,MAAM,EACN,kBAAkB,GAKnB;QACC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;QAEzD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CACpB,CAAC,OAA2B,EAAY,EAAE,CACxC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAClD,CAAA;IACH,CAAC;IAEO,cAAc,CACpB,OAA2B,EAC3B,OAAyB,EACzB,QAA2B;QAE3B,MAAM,WAAW,GAAG,CAAC,GAAiB,EAAW,EAAE,CACjD,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAA;QAC9B,MAAM,OAAO,GAAG,CACd,GAAmB,EACnB,GAAmB,EACH,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEpC,MAAM,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;YAC/B,QAAQ,CAAC,QAAQ;iBACd,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;iBAClB,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;iBACnB,IAAI,CAAC,WAAW,CAAC,CAAA;QAEtB,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI;SAC1B,CAAA;IACH,CAAC;;AA/QH,gCAgRC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport { parseStepArgument } from '../step_arguments'\nimport { formatLocation, GherkinDocumentParser, PickleParser } from './helpers'\nimport {\n getGherkinExampleRuleMap,\n getGherkinScenarioLocationMap,\n} from './helpers/gherkin_document_parser'\nimport { ITestCaseAttempt } from './helpers/event_data_collector'\nimport { durationToNanoseconds } from './helpers/duration_helpers'\nimport Formatter, { IFormatterOptions } from './'\n\nconst { getGherkinStepMap, getGherkinScenarioMap } = GherkinDocumentParser\n\nconst { getScenarioDescription, getPickleStepMap, getStepKeyword } =\n PickleParser\n\nexport interface IJsonFeature {\n description: string\n elements: IJsonScenario[]\n id: string\n keyword: string\n line: number\n name: string\n tags: IJsonTag[]\n uri: string\n}\n\nexport interface IJsonScenario {\n description: string\n id: string\n keyword: string\n line: number\n name: string\n steps: IJsonStep[]\n tags: IJsonTag[]\n type: string\n}\n\nexport interface IJsonStep {\n arguments?: any // TODO\n embeddings?: any // TODO\n hidden?: boolean\n keyword?: string // TODO, not optional\n line?: number\n match?: any // TODO\n name?: string\n result?: any // TODO\n}\n\nexport interface IJsonTag {\n name: string\n line: number\n}\n\ninterface IBuildJsonFeatureOptions {\n feature: messages.Feature\n elements: IJsonScenario[]\n uri: string\n}\n\ninterface IBuildJsonScenarioOptions {\n feature: messages.Feature\n gherkinScenarioMap: Record<string, messages.Scenario>\n gherkinExampleRuleMap: Record<string, messages.Rule>\n gherkinScenarioLocationMap: Record<string, messages.Location>\n pickle: messages.Pickle\n steps: IJsonStep[]\n}\n\ninterface IBuildJsonStepOptions {\n isBeforeHook: boolean\n gherkinStepMap: Record<string, messages.Step>\n pickleStepMap: Record<string, messages.PickleStep>\n testStep: messages.TestStep\n testStepAttachments: messages.Attachment[]\n testStepResult: messages.TestStepResult\n}\n\ninterface UriToTestCaseAttemptsMap {\n [uri: string]: ITestCaseAttempt[]\n}\n\nexport default class JsonFormatter extends Formatter {\n public static readonly documentation: string =\n 'Prints the feature as JSON. The JSON format is in maintenance mode. Please consider using the message formatter with the standalone json-formatter (https://github.com/cucumber/json-formatter).'\n\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', (envelope: messages.Envelope) => {\n if (doesHaveValue(envelope.testRunFinished)) {\n this.onTestRunFinished()\n }\n })\n }\n\n convertNameToId(obj: messages.Feature | messages.Pickle): string {\n return obj.name.replace(/ /g, '-').toLowerCase()\n }\n\n formatDataTable(dataTable: messages.PickleTable): any {\n return {\n rows: dataTable.rows.map((row) => ({\n cells: row.cells.map((x) => x.value),\n })),\n }\n }\n\n formatDocString(\n docString: messages.PickleDocString,\n gherkinStep: messages.Step\n ): any {\n return {\n content: docString.content,\n line: gherkinStep.docString.location.line,\n }\n }\n\n formatStepArgument(\n stepArgument: messages.PickleStepArgument,\n gherkinStep: messages.Step\n ): any {\n if (doesNotHaveValue(stepArgument)) {\n return []\n }\n return [\n parseStepArgument<any>(stepArgument, {\n dataTable: (dataTable) => this.formatDataTable(dataTable),\n docString: (docString) => this.formatDocString(docString, gherkinStep),\n }),\n ]\n }\n\n onTestRunFinished(): void {\n const groupedTestCaseAttempts: UriToTestCaseAttemptsMap = {}\n this.eventDataCollector\n .getTestCaseAttempts()\n .forEach((testCaseAttempt: ITestCaseAttempt) => {\n if (!testCaseAttempt.willBeRetried) {\n const uri = testCaseAttempt.pickle.uri\n if (doesNotHaveValue(groupedTestCaseAttempts[uri])) {\n groupedTestCaseAttempts[uri] = []\n }\n groupedTestCaseAttempts[uri].push(testCaseAttempt)\n }\n })\n const features = Object.keys(groupedTestCaseAttempts).map((uri) => {\n const group = groupedTestCaseAttempts[uri]\n const { gherkinDocument } = group[0]\n const gherkinStepMap = getGherkinStepMap(gherkinDocument)\n const gherkinScenarioMap = getGherkinScenarioMap(gherkinDocument)\n const gherkinExampleRuleMap = getGherkinExampleRuleMap(gherkinDocument)\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n const elements = group.map((testCaseAttempt: ITestCaseAttempt) => {\n const { pickle } = testCaseAttempt\n const pickleStepMap = getPickleStepMap(pickle)\n let isBeforeHook = true\n const steps = testCaseAttempt.testCase.testSteps.map((testStep) => {\n isBeforeHook = isBeforeHook && !doesHaveValue(testStep.pickleStepId)\n return this.getStepData({\n isBeforeHook,\n gherkinStepMap,\n pickleStepMap,\n testStep,\n testStepAttachments: testCaseAttempt.stepAttachments[testStep.id],\n testStepResult: testCaseAttempt.stepResults[testStep.id],\n })\n })\n return this.getScenarioData({\n feature: gherkinDocument.feature,\n gherkinScenarioLocationMap,\n gherkinExampleRuleMap,\n gherkinScenarioMap,\n pickle,\n steps,\n })\n })\n return this.getFeatureData({\n feature: gherkinDocument.feature,\n elements,\n uri,\n })\n })\n this.log(JSON.stringify(features, null, 2))\n }\n\n getFeatureData({\n feature,\n elements,\n uri,\n }: IBuildJsonFeatureOptions): IJsonFeature {\n return {\n description: feature.description,\n elements,\n id: this.convertNameToId(feature),\n line: feature.location.line,\n keyword: feature.keyword,\n name: feature.name,\n tags: this.getFeatureTags(feature),\n uri,\n }\n }\n\n getScenarioData({\n feature,\n gherkinScenarioLocationMap,\n gherkinExampleRuleMap,\n gherkinScenarioMap,\n pickle,\n steps,\n }: IBuildJsonScenarioOptions): IJsonScenario {\n const description = getScenarioDescription({\n pickle,\n gherkinScenarioMap,\n })\n return {\n description,\n id: this.formatScenarioId({ feature, pickle, gherkinExampleRuleMap }),\n keyword: gherkinScenarioMap[pickle.astNodeIds[0]].keyword,\n line: gherkinScenarioLocationMap[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ].line,\n name: pickle.name,\n steps,\n tags: this.getScenarioTags({ feature, pickle, gherkinScenarioMap }),\n type: 'scenario',\n }\n }\n\n private formatScenarioId({\n feature,\n pickle,\n gherkinExampleRuleMap,\n }: {\n feature: messages.Feature\n pickle: messages.Pickle\n gherkinExampleRuleMap: Record<string, messages.Rule>\n }): string {\n let parts: any[]\n const rule = gherkinExampleRuleMap[pickle.astNodeIds[0]]\n if (doesHaveValue(rule)) {\n parts = [feature, rule, pickle]\n } else {\n parts = [feature, pickle]\n }\n return parts.map((part) => this.convertNameToId(part)).join(';')\n }\n\n getStepData({\n isBeforeHook,\n gherkinStepMap,\n pickleStepMap,\n testStep,\n testStepAttachments,\n testStepResult,\n }: IBuildJsonStepOptions): IJsonStep {\n const data: IJsonStep = {}\n if (doesHaveValue(testStep.pickleStepId)) {\n const pickleStep = pickleStepMap[testStep.pickleStepId]\n data.arguments = this.formatStepArgument(\n pickleStep.argument,\n gherkinStepMap[pickleStep.astNodeIds[0]]\n )\n data.keyword = getStepKeyword({ pickleStep, gherkinStepMap })\n data.line = gherkinStepMap[pickleStep.astNodeIds[0]].location.line\n data.name = pickleStep.text\n } else {\n data.keyword = isBeforeHook ? 'Before' : 'After'\n data.hidden = true\n }\n if (\n doesHaveValue(testStep.stepDefinitionIds) &&\n testStep.stepDefinitionIds.length === 1\n ) {\n const stepDefinition = this.supportCodeLibrary.stepDefinitions.find(\n (s) => s.id === testStep.stepDefinitionIds[0]\n )\n data.match = { location: formatLocation(stepDefinition) }\n }\n const { message, status } = testStepResult\n data.result = {\n status: messages.TestStepResultStatus[status].toLowerCase(),\n }\n if (doesHaveValue(testStepResult.duration)) {\n data.result.duration = durationToNanoseconds(testStepResult.duration)\n }\n if (\n status === messages.TestStepResultStatus.FAILED &&\n doesHaveValue(message)\n ) {\n data.result.error_message = message\n }\n if (testStepAttachments?.length > 0) {\n data.embeddings = testStepAttachments.map((attachment) => ({\n data:\n attachment.contentEncoding ===\n messages.AttachmentContentEncoding.IDENTITY\n ? Buffer.from(attachment.body).toString('base64')\n : attachment.body,\n mime_type: attachment.mediaType,\n }))\n }\n return data\n }\n\n getFeatureTags(feature: messages.Feature): IJsonTag[] {\n return feature.tags.map((tagData) => ({\n name: tagData.name,\n line: tagData.location.line,\n }))\n }\n\n getScenarioTags({\n feature,\n pickle,\n gherkinScenarioMap,\n }: {\n feature: messages.Feature\n pickle: messages.Pickle\n gherkinScenarioMap: Record<string, messages.Scenario>\n }): IJsonTag[] {\n const scenario = gherkinScenarioMap[pickle.astNodeIds[0]]\n\n return pickle.tags.map(\n (tagData: messages.PickleTag): IJsonTag =>\n this.getScenarioTag(tagData, feature, scenario)\n )\n }\n\n private getScenarioTag(\n tagData: messages.PickleTag,\n feature: messages.Feature,\n scenario: messages.Scenario\n ): IJsonTag {\n const byAstNodeId = (tag: messages.Tag): boolean =>\n tag.id === tagData.astNodeId\n const flatten = (\n acc: messages.Tag[],\n val: messages.Tag[]\n ): messages.Tag[] => acc.concat(val)\n\n const tag =\n feature.tags.find(byAstNodeId) ||\n scenario.tags.find(byAstNodeId) ||\n scenario.examples\n .map((e) => e.tags)\n .reduce(flatten, [])\n .find(byAstNodeId)\n\n return {\n name: tagData.name,\n line: tag?.location?.line,\n }\n }\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import ProgressBar from 'progress';
|
|
2
|
-
import * as messages from '@cucumber/messages';
|
|
3
|
-
import Formatter, { IFormatterOptions } from './';
|
|
4
|
-
export default class ProgressBarFormatter extends Formatter {
|
|
5
|
-
private numberOfSteps;
|
|
6
|
-
private testRunStarted;
|
|
7
|
-
private issueCount;
|
|
8
|
-
progressBar: ProgressBar;
|
|
9
|
-
static readonly documentation: string;
|
|
10
|
-
constructor(options: IFormatterOptions);
|
|
11
|
-
incrementStepCount(pickleId: string): void;
|
|
12
|
-
initializeProgressBar(): void;
|
|
13
|
-
logProgress({ testStepId, testCaseStartedId, }: messages.TestStepFinished): void;
|
|
14
|
-
logUndefinedParametertype(parameterType: messages.UndefinedParameterType): void;
|
|
15
|
-
logErrorIfNeeded(testCaseFinished: messages.TestCaseFinished): void;
|
|
16
|
-
logSummary(testRunFinished: messages.TestRunFinished): void;
|
|
17
|
-
parseEnvelope(envelope: messages.Envelope): void;
|
|
18
|
-
}
|