@dev-blinq/cucumber-js 1.0.0-amdocs
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +68 -0
- package/api/index.d.ts +6 -0
- package/bin/cucumber-js +3 -0
- package/bin/cucumber.js +3 -0
- package/bin/cucumber.ts +2 -0
- package/bin/download-install.js +167 -0
- package/lib/api/console_logger.d.ts +12 -0
- package/lib/api/console_logger.js +24 -0
- package/lib/api/console_logger.js.map +1 -0
- package/lib/api/convert_configuration.d.ts +4 -0
- package/lib/api/convert_configuration.js +66 -0
- package/lib/api/convert_configuration.js.map +1 -0
- package/lib/api/environment.d.ts +2 -0
- package/lib/api/environment.js +14 -0
- package/lib/api/environment.js.map +1 -0
- package/lib/api/formatters.d.ts +20 -0
- package/lib/api/formatters.js +61 -0
- package/lib/api/formatters.js.map +1 -0
- package/lib/api/gherkin.d.ts +21 -0
- package/lib/api/gherkin.js +146 -0
- package/lib/api/gherkin.js.map +1 -0
- package/lib/api/index.d.ts +12 -0
- package/lib/api/index.js +28 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/load_configuration.d.ts +9 -0
- package/lib/api/load_configuration.js +41 -0
- package/lib/api/load_configuration.js.map +1 -0
- package/lib/api/load_sources.d.ts +9 -0
- package/lib/api/load_sources.js +53 -0
- package/lib/api/load_sources.js.map +1 -0
- package/lib/api/load_support.d.ts +10 -0
- package/lib/api/load_support.js +30 -0
- package/lib/api/load_support.js.map +1 -0
- package/lib/api/paths.d.ts +8 -0
- package/lib/api/paths.js +102 -0
- package/lib/api/paths.js.map +1 -0
- package/lib/api/plugins.d.ts +4 -0
- package/lib/api/plugins.js +19 -0
- package/lib/api/plugins.js.map +1 -0
- package/lib/api/run_cucumber.d.ts +11 -0
- package/lib/api/run_cucumber.js +115 -0
- package/lib/api/run_cucumber.js.map +1 -0
- package/lib/api/runtime.d.ts +21 -0
- package/lib/api/runtime.js +36 -0
- package/lib/api/runtime.js.map +1 -0
- package/lib/api/support.d.ts +9 -0
- package/lib/api/support.js +26 -0
- package/lib/api/support.js.map +1 -0
- package/lib/api/test_helpers.d.ts +3 -0
- package/lib/api/test_helpers.js +36 -0
- package/lib/api/test_helpers.js.map +1 -0
- package/lib/api/types.d.ts +177 -0
- package/lib/api/types.js +3 -0
- package/lib/api/types.js.map +1 -0
- package/lib/api/wrapper.mjs +6 -0
- package/lib/cli/helpers.d.ts +39 -0
- package/lib/cli/helpers.js +224 -0
- package/lib/cli/helpers.js.map +1 -0
- package/lib/cli/i18n.d.ts +2 -0
- package/lib/cli/i18n.js +70 -0
- package/lib/cli/i18n.js.map +1 -0
- package/lib/cli/index.d.ts +21 -0
- package/lib/cli/index.js +64 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/install_validator.d.ts +1 -0
- package/lib/cli/install_validator.js +18 -0
- package/lib/cli/install_validator.js.map +1 -0
- package/lib/cli/run.d.ts +1 -0
- package/lib/cli/run.js +44 -0
- package/lib/cli/run.js.map +1 -0
- package/lib/cli/validate_node_engine_version.d.ts +10 -0
- package/lib/cli/validate_node_engine_version.js +24 -0
- package/lib/cli/validate_node_engine_version.js.map +1 -0
- package/lib/configuration/argv_parser.d.ts +20 -0
- package/lib/configuration/argv_parser.js +104 -0
- package/lib/configuration/argv_parser.js.map +1 -0
- package/lib/configuration/axios_client.d.ts +1 -0
- package/lib/configuration/axios_client.js +40 -0
- package/lib/configuration/axios_client.js.map +1 -0
- package/lib/configuration/check_schema.d.ts +2 -0
- package/lib/configuration/check_schema.js +60 -0
- package/lib/configuration/check_schema.js.map +1 -0
- package/lib/configuration/default_configuration.d.ts +2 -0
- package/lib/configuration/default_configuration.js +29 -0
- package/lib/configuration/default_configuration.js.map +1 -0
- package/lib/configuration/from_file.d.ts +3 -0
- package/lib/configuration/from_file.js +85 -0
- package/lib/configuration/from_file.js.map +1 -0
- package/lib/configuration/helpers.d.ts +1 -0
- package/lib/configuration/helpers.js +11 -0
- package/lib/configuration/helpers.js.map +1 -0
- package/lib/configuration/index.d.ts +7 -0
- package/lib/configuration/index.js +29 -0
- package/lib/configuration/index.js.map +1 -0
- package/lib/configuration/locate_file.d.ts +1 -0
- package/lib/configuration/locate_file.js +21 -0
- package/lib/configuration/locate_file.js.map +1 -0
- package/lib/configuration/merge_configurations.d.ts +2 -0
- package/lib/configuration/merge_configurations.js +48 -0
- package/lib/configuration/merge_configurations.js.map +1 -0
- package/lib/configuration/option_splitter.d.ts +3 -0
- package/lib/configuration/option_splitter.js +23 -0
- package/lib/configuration/option_splitter.js.map +1 -0
- package/lib/configuration/types.d.ts +30 -0
- package/lib/configuration/types.js +3 -0
- package/lib/configuration/types.js.map +1 -0
- package/lib/configuration/validate_configuration.d.ts +3 -0
- package/lib/configuration/validate_configuration.js +13 -0
- package/lib/configuration/validate_configuration.js.map +1 -0
- package/lib/filter_stack_trace.d.ts +3 -0
- package/lib/filter_stack_trace.js +38 -0
- package/lib/filter_stack_trace.js.map +1 -0
- package/lib/formatter/api.d.ts +2 -0
- package/lib/formatter/api.js +53 -0
- package/lib/formatter/api.js.map +1 -0
- package/lib/formatter/builder.d.ts +37 -0
- package/lib/formatter/builder.js +101 -0
- package/lib/formatter/builder.js.map +1 -0
- package/lib/formatter/bvt_analysis_formatter.d.ts +30 -0
- package/lib/formatter/bvt_analysis_formatter.js +334 -0
- package/lib/formatter/bvt_analysis_formatter.js.map +1 -0
- package/lib/formatter/feature_data_format.d.ts +23 -0
- package/lib/formatter/feature_data_format.js +182 -0
- package/lib/formatter/feature_data_format.js.map +1 -0
- package/lib/formatter/fixtures/typescript.d.ts +2 -0
- package/lib/formatter/fixtures/typescript.js +6 -0
- package/lib/formatter/fixtures/typescript.js.map +1 -0
- package/lib/formatter/get_color_fns.d.ts +15 -0
- package/lib/formatter/get_color_fns.js +56 -0
- package/lib/formatter/get_color_fns.js.map +1 -0
- package/lib/formatter/helpers/constants.d.ts +44 -0
- package/lib/formatter/helpers/constants.js +50 -0
- package/lib/formatter/helpers/constants.js.map +1 -0
- package/lib/formatter/helpers/duration_helpers.d.ts +2 -0
- package/lib/formatter/helpers/duration_helpers.js +9 -0
- package/lib/formatter/helpers/duration_helpers.js.map +1 -0
- package/lib/formatter/helpers/event_data_collector.d.ts +30 -0
- package/lib/formatter/helpers/event_data_collector.js +126 -0
- package/lib/formatter/helpers/event_data_collector.js.map +1 -0
- package/lib/formatter/helpers/formatters.d.ts +6 -0
- package/lib/formatter/helpers/formatters.js +45 -0
- package/lib/formatter/helpers/formatters.js.map +1 -0
- package/lib/formatter/helpers/gherkin_document_parser.d.ts +5 -0
- package/lib/formatter/helpers/gherkin_document_parser.js +66 -0
- package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -0
- package/lib/formatter/helpers/index.d.ts +10 -0
- package/lib/formatter/helpers/index.js +52 -0
- package/lib/formatter/helpers/index.js.map +1 -0
- package/lib/formatter/helpers/issue_helpers.d.ts +19 -0
- package/lib/formatter/helpers/issue_helpers.js +59 -0
- package/lib/formatter/helpers/issue_helpers.js.map +1 -0
- package/lib/formatter/helpers/keyword_type.d.ts +11 -0
- package/lib/formatter/helpers/keyword_type.js +32 -0
- package/lib/formatter/helpers/keyword_type.js.map +1 -0
- package/lib/formatter/helpers/location_helpers.d.ts +2 -0
- package/lib/formatter/helpers/location_helpers.js +17 -0
- package/lib/formatter/helpers/location_helpers.js.map +1 -0
- package/lib/formatter/helpers/pickle_parser.d.ts +17 -0
- package/lib/formatter/helpers/pickle_parser.js +28 -0
- package/lib/formatter/helpers/pickle_parser.js.map +1 -0
- package/lib/formatter/helpers/report_generator.d.ts +148 -0
- package/lib/formatter/helpers/report_generator.js +573 -0
- package/lib/formatter/helpers/report_generator.js.map +1 -0
- package/lib/formatter/helpers/step_argument_formatter.d.ts +2 -0
- package/lib/formatter/helpers/step_argument_formatter.js +48 -0
- package/lib/formatter/helpers/step_argument_formatter.js.map +1 -0
- package/lib/formatter/helpers/summary_helpers.d.ts +9 -0
- package/lib/formatter/helpers/summary_helpers.js +96 -0
- package/lib/formatter/helpers/summary_helpers.js.map +1 -0
- package/lib/formatter/helpers/test_case_attempt_formatter.d.ts +12 -0
- package/lib/formatter/helpers/test_case_attempt_formatter.js +114 -0
- package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -0
- package/lib/formatter/helpers/test_case_attempt_parser.d.ts +32 -0
- package/lib/formatter/helpers/test_case_attempt_parser.js +135 -0
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -0
- package/lib/formatter/helpers/upload_serivce.d.ts +26 -0
- package/lib/formatter/helpers/upload_serivce.js +237 -0
- package/lib/formatter/helpers/upload_serivce.js.map +1 -0
- package/lib/formatter/helpers/uploader.d.ts +12 -0
- package/lib/formatter/helpers/uploader.js +151 -0
- package/lib/formatter/helpers/uploader.js.map +1 -0
- package/lib/formatter/helpers/usage_helpers/index.d.ts +23 -0
- package/lib/formatter/helpers/usage_helpers/index.js +111 -0
- package/lib/formatter/helpers/usage_helpers/index.js.map +1 -0
- package/lib/formatter/html_formatter.d.ts +7 -0
- package/lib/formatter/html_formatter.js +30 -0
- package/lib/formatter/html_formatter.js.map +1 -0
- package/lib/formatter/index.d.ts +53 -0
- package/lib/formatter/index.js +21 -0
- package/lib/formatter/index.js.map +1 -0
- package/lib/formatter/json_formatter.d.ts +78 -0
- package/lib/formatter/json_formatter.js +230 -0
- package/lib/formatter/json_formatter.js.map +1 -0
- package/lib/formatter/junit_formatter.d.ts +17 -0
- package/lib/formatter/junit_formatter.js +181 -0
- package/lib/formatter/junit_formatter.js.map +1 -0
- package/lib/formatter/message_formatter.d.ts +5 -0
- package/lib/formatter/message_formatter.js +15 -0
- package/lib/formatter/message_formatter.js.map +1 -0
- package/lib/formatter/progress_bar_formatter.d.ts +18 -0
- package/lib/formatter/progress_bar_formatter.js +99 -0
- package/lib/formatter/progress_bar_formatter.js.map +1 -0
- package/lib/formatter/progress_formatter.d.ts +9 -0
- package/lib/formatter/progress_formatter.js +59 -0
- package/lib/formatter/progress_formatter.js.map +1 -0
- package/lib/formatter/rerun_formatter.d.ts +13 -0
- package/lib/formatter/rerun_formatter.js +80 -0
- package/lib/formatter/rerun_formatter.js.map +1 -0
- package/lib/formatter/snippets_formatter.d.ts +6 -0
- package/lib/formatter/snippets_formatter.js +61 -0
- package/lib/formatter/snippets_formatter.js.map +1 -0
- package/lib/formatter/step_definition_snippet_builder/index.d.ts +20 -0
- package/lib/formatter/step_definition_snippet_builder/index.js +46 -0
- package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -0
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts +7 -0
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +46 -0
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -0
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts +16 -0
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js +11 -0
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -0
- package/lib/formatter/summary_formatter.d.ts +14 -0
- package/lib/formatter/summary_formatter.js +68 -0
- package/lib/formatter/summary_formatter.js.map +1 -0
- package/lib/formatter/usage_formatter.d.ts +6 -0
- package/lib/formatter/usage_formatter.js +98 -0
- package/lib/formatter/usage_formatter.js.map +1 -0
- package/lib/formatter/usage_json_formatter.d.ts +7 -0
- package/lib/formatter/usage_json_formatter.js +34 -0
- package/lib/formatter/usage_json_formatter.js.map +1 -0
- package/lib/importer.js +13 -0
- package/lib/index.d.ts +58 -0
- package/lib/index.js +109 -0
- package/lib/index.js.map +1 -0
- package/lib/logger.d.ts +5 -0
- package/lib/logger.js +3 -0
- package/lib/logger.js.map +1 -0
- package/lib/models/data_table.d.ts +10 -0
- package/lib/models/data_table.js +46 -0
- package/lib/models/data_table.js.map +1 -0
- package/lib/models/definition.d.ts +55 -0
- package/lib/models/definition.js +22 -0
- package/lib/models/definition.js.map +1 -0
- package/lib/models/gherkin_step_keyword.d.ts +1 -0
- package/lib/models/gherkin_step_keyword.js +3 -0
- package/lib/models/gherkin_step_keyword.js.map +1 -0
- package/lib/models/pickle_order.d.ts +1 -0
- package/lib/models/pickle_order.js +3 -0
- package/lib/models/pickle_order.js.map +1 -0
- package/lib/models/step_definition.d.ts +11 -0
- package/lib/models/step_definition.js +37 -0
- package/lib/models/step_definition.js.map +1 -0
- package/lib/models/test_case_hook_definition.d.ts +10 -0
- package/lib/models/test_case_hook_definition.js +27 -0
- package/lib/models/test_case_hook_definition.js.map +1 -0
- package/lib/models/test_run_hook_definition.d.ts +3 -0
- package/lib/models/test_run_hook_definition.js +10 -0
- package/lib/models/test_run_hook_definition.js.map +1 -0
- package/lib/models/test_step_hook_definition.d.ts +9 -0
- package/lib/models/test_step_hook_definition.js +26 -0
- package/lib/models/test_step_hook_definition.js.map +1 -0
- package/lib/pickle_filter.d.ts +42 -0
- package/lib/pickle_filter.js +99 -0
- package/lib/pickle_filter.js.map +1 -0
- package/lib/plugin/index.d.ts +2 -0
- package/lib/plugin/index.js +19 -0
- package/lib/plugin/index.js.map +1 -0
- package/lib/plugin/plugin_manager.d.ts +13 -0
- package/lib/plugin/plugin_manager.js +36 -0
- package/lib/plugin/plugin_manager.js.map +1 -0
- package/lib/plugin/types.d.ts +14 -0
- package/lib/plugin/types.js +3 -0
- package/lib/plugin/types.js.map +1 -0
- package/lib/publish/http_stream.d.ts +30 -0
- package/lib/publish/http_stream.js +112 -0
- package/lib/publish/http_stream.js.map +1 -0
- package/lib/publish/index.d.ts +2 -0
- package/lib/publish/index.js +5 -0
- package/lib/publish/index.js.map +1 -0
- package/lib/publish/publish_plugin.d.ts +2 -0
- package/lib/publish/publish_plugin.js +48 -0
- package/lib/publish/publish_plugin.js.map +1 -0
- package/lib/runtime/assemble_test_cases.d.ts +13 -0
- package/lib/runtime/assemble_test_cases.js +88 -0
- package/lib/runtime/assemble_test_cases.js.map +1 -0
- package/lib/runtime/attachment_manager/index.d.ts +33 -0
- package/lib/runtime/attachment_manager/index.js +119 -0
- package/lib/runtime/attachment_manager/index.js.map +1 -0
- package/lib/runtime/format_error.d.ts +2 -0
- package/lib/runtime/format_error.js +36 -0
- package/lib/runtime/format_error.js.map +1 -0
- package/lib/runtime/helpers.d.ts +6 -0
- package/lib/runtime/helpers.js +101 -0
- package/lib/runtime/helpers.js.map +1 -0
- package/lib/runtime/index.d.ts +40 -0
- package/lib/runtime/index.js +76 -0
- package/lib/runtime/index.js.map +1 -0
- package/lib/runtime/parallel/command_types.d.ts +32 -0
- package/lib/runtime/parallel/command_types.js +3 -0
- package/lib/runtime/parallel/command_types.js.map +1 -0
- package/lib/runtime/parallel/coordinator.d.ts +72 -0
- package/lib/runtime/parallel/coordinator.js +222 -0
- package/lib/runtime/parallel/coordinator.js.map +1 -0
- package/lib/runtime/parallel/run_worker.d.ts +1 -0
- package/lib/runtime/parallel/run_worker.js +29 -0
- package/lib/runtime/parallel/run_worker.js.map +1 -0
- package/lib/runtime/parallel/worker.d.ts +26 -0
- package/lib/runtime/parallel/worker.js +87 -0
- package/lib/runtime/parallel/worker.js.map +1 -0
- package/lib/runtime/run_test_run_hooks.d.ts +3 -0
- package/lib/runtime/run_test_run_hooks.js +28 -0
- package/lib/runtime/run_test_run_hooks.js.map +1 -0
- package/lib/runtime/step_runner.d.ts +16 -0
- package/lib/runtime/step_runner.js +88 -0
- package/lib/runtime/step_runner.js.map +1 -0
- package/lib/runtime/stopwatch.d.ts +12 -0
- package/lib/runtime/stopwatch.js +34 -0
- package/lib/runtime/stopwatch.js.map +1 -0
- package/lib/runtime/test_case_runner.d.ts +55 -0
- package/lib/runtime/test_case_runner.js +277 -0
- package/lib/runtime/test_case_runner.js.map +1 -0
- package/lib/step_arguments.d.ts +6 -0
- package/lib/step_arguments.js +19 -0
- package/lib/step_arguments.js.map +1 -0
- package/lib/support_code_library_builder/build_parameter_type.d.ts +3 -0
- package/lib/support_code_library_builder/build_parameter_type.js +13 -0
- package/lib/support_code_library_builder/build_parameter_type.js.map +1 -0
- package/lib/support_code_library_builder/get_definition_line_and_uri.d.ts +3 -0
- package/lib/support_code_library_builder/get_definition_line_and_uri.js +29 -0
- package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +1 -0
- package/lib/support_code_library_builder/index.d.ts +74 -0
- package/lib/support_code_library_builder/index.js +304 -0
- package/lib/support_code_library_builder/index.js.map +1 -0
- package/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts +2 -0
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js +16 -0
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js.map +1 -0
- package/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts +7 -0
- package/lib/support_code_library_builder/sourced_parameter_type_registry.js +19 -0
- package/lib/support_code_library_builder/sourced_parameter_type_registry.js.map +1 -0
- package/lib/support_code_library_builder/types.d.ts +88 -0
- package/lib/support_code_library_builder/types.js +3 -0
- package/lib/support_code_library_builder/types.js.map +1 -0
- package/lib/support_code_library_builder/validate_arguments.d.ts +12 -0
- package/lib/support_code_library_builder/validate_arguments.js +73 -0
- package/lib/support_code_library_builder/validate_arguments.js.map +1 -0
- package/lib/support_code_library_builder/world.d.ts +18 -0
- package/lib/support_code_library_builder/world.js +11 -0
- package/lib/support_code_library_builder/world.js.map +1 -0
- package/lib/time.d.ts +18 -0
- package/lib/time.js +61 -0
- package/lib/time.js.map +1 -0
- package/lib/try_require.d.ts +7 -0
- package/lib/try_require.js +26 -0
- package/lib/try_require.js.map +1 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.js +3 -0
- package/lib/types/index.js.map +1 -0
- package/lib/uncaught_exception_manager.d.ts +7 -0
- package/lib/uncaught_exception_manager.js +12 -0
- package/lib/uncaught_exception_manager.js.map +1 -0
- package/lib/user_code_runner.d.ts +14 -0
- package/lib/user_code_runner.js +82 -0
- package/lib/user_code_runner.js.map +1 -0
- package/lib/value_checker.d.ts +3 -0
- package/lib/value_checker.js +19 -0
- package/lib/value_checker.js.map +1 -0
- package/lib/version.d.ts +1 -0
- package/lib/version.js +6 -0
- package/lib/version.js.map +1 -0
- package/lib/wrapper.mjs +44 -0
- package/package.json +197 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class World {
|
|
4
|
+
constructor({ attach, log, parameters }) {
|
|
5
|
+
this.attach = attach;
|
|
6
|
+
this.log = log;
|
|
7
|
+
this.parameters = parameters;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.default = World;
|
|
11
|
+
//# sourceMappingURL=world.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world.js","sourceRoot":"","sources":["../../src/support_code_library_builder/world.ts"],"names":[],"mappings":";;AAgBA,MAAqB,KAAK;IAOxB,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAiC;QACpE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAZD,wBAYC","sourcesContent":["import { ICreateAttachment, ICreateLog } from '../runtime/attachment_manager'\n\nexport interface IWorldOptions<ParametersType = any> {\n attach: ICreateAttachment\n log: ICreateLog\n parameters: ParametersType\n}\n\nexport interface IWorld<ParametersType = any> {\n readonly attach: ICreateAttachment\n readonly log: ICreateLog\n readonly parameters: ParametersType\n\n [key: string]: any\n}\n\nexport default class World<ParametersType = any>\n implements IWorld<ParametersType>\n{\n public readonly attach: ICreateAttachment\n public readonly log: ICreateLog\n public readonly parameters: ParametersType\n\n constructor({ attach, log, parameters }: IWorldOptions<ParametersType>) {\n this.attach = attach\n this.log = log\n this.parameters = parameters\n }\n}\n"]}
|
package/lib/time.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { performance } from 'perf_hooks';
|
|
4
|
+
import * as messages from '@cucumber/messages';
|
|
5
|
+
interface ProtectedTimingBuiltins {
|
|
6
|
+
clearImmediate: typeof clearImmediate;
|
|
7
|
+
clearInterval: typeof clearInterval;
|
|
8
|
+
clearTimeout: typeof clearTimeout;
|
|
9
|
+
Date: typeof Date;
|
|
10
|
+
setImmediate: typeof setImmediate;
|
|
11
|
+
setInterval: typeof setInterval;
|
|
12
|
+
setTimeout: typeof setTimeout;
|
|
13
|
+
performance: typeof performance;
|
|
14
|
+
}
|
|
15
|
+
declare const methods: Partial<ProtectedTimingBuiltins>;
|
|
16
|
+
export declare function durationBetweenTimestamps(startedTimestamp: messages.Timestamp, finishedTimestamp: messages.Timestamp): messages.Duration;
|
|
17
|
+
export declare function wrapPromiseWithTimeout<T>(promise: Promise<T>, timeoutInMilliseconds: number, timeoutMessage?: string): Promise<T>;
|
|
18
|
+
export default methods;
|
package/lib/time.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.wrapPromiseWithTimeout = exports.durationBetweenTimestamps = void 0;
|
|
27
|
+
const perf_hooks_1 = require("perf_hooks");
|
|
28
|
+
const messages = __importStar(require("@cucumber/messages"));
|
|
29
|
+
const methods = {
|
|
30
|
+
clearInterval: clearInterval.bind(global),
|
|
31
|
+
clearTimeout: clearTimeout.bind(global),
|
|
32
|
+
Date,
|
|
33
|
+
setInterval: setInterval.bind(global),
|
|
34
|
+
setTimeout: setTimeout.bind(global),
|
|
35
|
+
performance: perf_hooks_1.performance,
|
|
36
|
+
};
|
|
37
|
+
if (typeof setImmediate !== 'undefined') {
|
|
38
|
+
methods.setImmediate = setImmediate.bind(global);
|
|
39
|
+
methods.clearImmediate = clearImmediate.bind(global);
|
|
40
|
+
}
|
|
41
|
+
function durationBetweenTimestamps(startedTimestamp, finishedTimestamp) {
|
|
42
|
+
const durationMillis = messages.TimeConversion.timestampToMillisecondsSinceEpoch(finishedTimestamp) -
|
|
43
|
+
messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp);
|
|
44
|
+
return messages.TimeConversion.millisecondsToDuration(durationMillis);
|
|
45
|
+
}
|
|
46
|
+
exports.durationBetweenTimestamps = durationBetweenTimestamps;
|
|
47
|
+
async function wrapPromiseWithTimeout(promise, timeoutInMilliseconds, timeoutMessage = '') {
|
|
48
|
+
let timeoutId;
|
|
49
|
+
if (timeoutMessage === '') {
|
|
50
|
+
timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`;
|
|
51
|
+
}
|
|
52
|
+
const timeoutPromise = new Promise((resolve, reject) => {
|
|
53
|
+
timeoutId = methods.setTimeout(() => {
|
|
54
|
+
reject(new Error(timeoutMessage));
|
|
55
|
+
}, timeoutInMilliseconds);
|
|
56
|
+
});
|
|
57
|
+
return await Promise.race([promise, timeoutPromise]).finally(() => methods.clearTimeout(timeoutId));
|
|
58
|
+
}
|
|
59
|
+
exports.wrapPromiseWithTimeout = wrapPromiseWithTimeout;
|
|
60
|
+
exports.default = methods;
|
|
61
|
+
//# sourceMappingURL=time.js.map
|
package/lib/time.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,6DAA8C;AAa9C,MAAM,OAAO,GAAqC;IAChD,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;IACzC,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IACvC,IAAI;IACJ,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;IACrC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;IACnC,WAAW,EAAX,wBAAW;CACZ,CAAA;AAED,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACvC,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAChD,OAAO,CAAC,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;CACrD;AAED,SAAgB,yBAAyB,CACvC,gBAAoC,EACpC,iBAAqC;IAErC,MAAM,cAAc,GAClB,QAAQ,CAAC,cAAc,CAAC,iCAAiC,CACvD,iBAAiB,CAClB;QACD,QAAQ,CAAC,cAAc,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,CAAA;IAC7E,OAAO,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAA;AACvE,CAAC;AAVD,8DAUC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,OAAmB,EACnB,qBAA6B,EAC7B,iBAAyB,EAAE;IAE3B,IAAI,SAAwC,CAAA;IAC5C,IAAI,cAAc,KAAK,EAAE,EAAE;QACzB,cAAc,GAAG,kCAAkC,qBAAqB,eAAe,CAAA;KACxF;IACD,MAAM,cAAc,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxD,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE;YAClC,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;QACnC,CAAC,EAAE,qBAAqB,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAChE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAChC,CAAA;AACH,CAAC;AAjBD,wDAiBC;AAED,kBAAe,OAAO,CAAA","sourcesContent":["import { performance } from 'perf_hooks'\nimport * as messages from '@cucumber/messages'\n\ninterface ProtectedTimingBuiltins {\n clearImmediate: typeof clearImmediate\n clearInterval: typeof clearInterval\n clearTimeout: typeof clearTimeout\n Date: typeof Date\n setImmediate: typeof setImmediate\n setInterval: typeof setInterval\n setTimeout: typeof setTimeout\n performance: typeof performance\n}\n\nconst methods: Partial<ProtectedTimingBuiltins> = {\n clearInterval: clearInterval.bind(global),\n clearTimeout: clearTimeout.bind(global),\n Date,\n setInterval: setInterval.bind(global),\n setTimeout: setTimeout.bind(global),\n performance,\n}\n\nif (typeof setImmediate !== 'undefined') {\n methods.setImmediate = setImmediate.bind(global)\n methods.clearImmediate = clearImmediate.bind(global)\n}\n\nexport function durationBetweenTimestamps(\n startedTimestamp: messages.Timestamp,\n finishedTimestamp: messages.Timestamp\n): messages.Duration {\n const durationMillis =\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(\n finishedTimestamp\n ) -\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp)\n return messages.TimeConversion.millisecondsToDuration(durationMillis)\n}\n\nexport async function wrapPromiseWithTimeout<T>(\n promise: Promise<T>,\n timeoutInMilliseconds: number,\n timeoutMessage: string = ''\n): Promise<T> {\n let timeoutId: ReturnType<typeof setTimeout>\n if (timeoutMessage === '') {\n timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`\n }\n const timeoutPromise = new Promise<T>((resolve, reject) => {\n timeoutId = methods.setTimeout(() => {\n reject(new Error(timeoutMessage))\n }, timeoutInMilliseconds)\n })\n return await Promise.race([promise, timeoutPromise]).finally(() =>\n methods.clearTimeout(timeoutId)\n )\n}\n\nexport default methods\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Provides a try guarded require call that will throw a more detailed error when
|
|
5
|
+
* the ERR_REQUIRE_ESM error code is encountered.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} path File path to require from.
|
|
8
|
+
*/
|
|
9
|
+
function tryRequire(path) {
|
|
10
|
+
try {
|
|
11
|
+
return require(path);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (error.code === 'ERR_REQUIRE_ESM') {
|
|
15
|
+
throw Error(`Cucumber expected a CommonJS module at '${path}' but found an ES module.
|
|
16
|
+
Either change the file to CommonJS syntax or use the --import directive instead of --require.
|
|
17
|
+
|
|
18
|
+
Original error message: ${error.message}`);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = tryRequire;
|
|
26
|
+
//# sourceMappingURL=try_require.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"try_require.js","sourceRoot":"","sources":["../src/try_require.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,SAAwB,UAAU,CAAC,IAAY;IAC7C,IAAI;QACF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;KACrB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE;YACpC,MAAM,KAAK,CACT,2CAA2C,IAAI;;;gCAGvB,KAAK,CAAC,OAAO,EAAE,CACxC,CAAA;SACF;aAAM;YACL,MAAM,KAAK,CAAA;SACZ;KACF;AACH,CAAC;AAfD,6BAeC","sourcesContent":["/**\n * Provides a try guarded require call that will throw a more detailed error when\n * the ERR_REQUIRE_ESM error code is encountered.\n *\n * @param {string} path File path to require from.\n */\nexport default function tryRequire(path: string) {\n try {\n return require(path)\n } catch (error) {\n if (error.code === 'ERR_REQUIRE_ESM') {\n throw Error(\n `Cucumber expected a CommonJS module at '${path}' but found an ES module.\n Either change the file to CommonJS syntax or use the --import directive instead of --require.\n \n Original error message: ${error.message}`\n )\n } else {\n throw error\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"","sourcesContent":["export interface ILineAndUri {\n line: number\n uri: string\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import UncaughtExceptionListener = NodeJS.UncaughtExceptionListener;
|
|
3
|
+
declare const UncaughtExceptionManager: {
|
|
4
|
+
registerHandler(handler: UncaughtExceptionListener): void;
|
|
5
|
+
unregisterHandler(handler: UncaughtExceptionListener): void;
|
|
6
|
+
};
|
|
7
|
+
export default UncaughtExceptionManager;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const UncaughtExceptionManager = {
|
|
4
|
+
registerHandler(handler) {
|
|
5
|
+
process.addListener('uncaughtException', handler);
|
|
6
|
+
},
|
|
7
|
+
unregisterHandler(handler) {
|
|
8
|
+
process.removeListener('uncaughtException', handler);
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
exports.default = UncaughtExceptionManager;
|
|
12
|
+
//# sourceMappingURL=uncaught_exception_manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncaught_exception_manager.js","sourceRoot":"","sources":["../src/uncaught_exception_manager.ts"],"names":[],"mappings":";;AAEA,MAAM,wBAAwB,GAAG;IAC/B,eAAe,CAAC,OAAkC;QAChD,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAED,iBAAiB,CAAC,OAAkC;QAClD,OAAO,CAAC,cAAc,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,wBAAwB,CAAA","sourcesContent":["import UncaughtExceptionListener = NodeJS.UncaughtExceptionListener\n\nconst UncaughtExceptionManager = {\n registerHandler(handler: UncaughtExceptionListener): void {\n process.addListener('uncaughtException', handler)\n },\n\n unregisterHandler(handler: UncaughtExceptionListener): void {\n process.removeListener('uncaughtException', handler)\n },\n}\n\nexport default UncaughtExceptionManager\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface IRunRequest {
|
|
2
|
+
argsArray: any[];
|
|
3
|
+
thisArg: any;
|
|
4
|
+
fn: Function;
|
|
5
|
+
timeoutInMilliseconds: number;
|
|
6
|
+
}
|
|
7
|
+
export interface IRunResponse {
|
|
8
|
+
error?: any;
|
|
9
|
+
result?: any;
|
|
10
|
+
}
|
|
11
|
+
declare const UserCodeRunner: {
|
|
12
|
+
run({ argsArray, thisArg, fn, timeoutInMilliseconds, }: IRunRequest): Promise<IRunResponse>;
|
|
13
|
+
};
|
|
14
|
+
export default UserCodeRunner;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const time_1 = require("./time");
|
|
7
|
+
const uncaught_exception_manager_1 = __importDefault(require("./uncaught_exception_manager"));
|
|
8
|
+
const util_1 = __importDefault(require("util"));
|
|
9
|
+
const value_checker_1 = require("./value_checker");
|
|
10
|
+
const UserCodeRunner = {
|
|
11
|
+
async run({ argsArray, thisArg, fn, timeoutInMilliseconds, }) {
|
|
12
|
+
const callbackPromise = new Promise((resolve, reject) => {
|
|
13
|
+
argsArray.push((error, result) => {
|
|
14
|
+
if ((0, value_checker_1.doesHaveValue)(error)) {
|
|
15
|
+
reject(error);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
resolve(result);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
let fnReturn;
|
|
23
|
+
try {
|
|
24
|
+
fnReturn = fn.apply(thisArg, argsArray);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
const error = e instanceof Error ? e : util_1.default.format(e);
|
|
28
|
+
return { error };
|
|
29
|
+
}
|
|
30
|
+
const racingPromises = [];
|
|
31
|
+
const callbackInterface = fn.length === argsArray.length;
|
|
32
|
+
const promiseInterface = (0, value_checker_1.doesHaveValue)(fnReturn) && typeof fnReturn.then === 'function';
|
|
33
|
+
if (callbackInterface && promiseInterface) {
|
|
34
|
+
return {
|
|
35
|
+
error: new Error('function uses multiple asynchronous interfaces: callback and promise\n' +
|
|
36
|
+
'to use the callback interface: do not return a promise\n' +
|
|
37
|
+
'to use the promise interface: remove the last argument to the function'),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
else if (callbackInterface) {
|
|
41
|
+
racingPromises.push(callbackPromise);
|
|
42
|
+
}
|
|
43
|
+
else if (promiseInterface) {
|
|
44
|
+
racingPromises.push(fnReturn);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return { result: fnReturn };
|
|
48
|
+
}
|
|
49
|
+
let exceptionHandler;
|
|
50
|
+
const uncaughtExceptionPromise = new Promise((resolve, reject) => {
|
|
51
|
+
exceptionHandler = reject;
|
|
52
|
+
uncaught_exception_manager_1.default.registerHandler(exceptionHandler);
|
|
53
|
+
});
|
|
54
|
+
racingPromises.push(uncaughtExceptionPromise);
|
|
55
|
+
let finalPromise = Promise.race(racingPromises);
|
|
56
|
+
if (timeoutInMilliseconds >= 0) {
|
|
57
|
+
const timeoutMessage = 'function timed out, ensure the ' +
|
|
58
|
+
(callbackInterface ? 'callback is executed' : 'promise resolves') +
|
|
59
|
+
` within ${timeoutInMilliseconds.toString()} milliseconds`;
|
|
60
|
+
finalPromise = (0, time_1.wrapPromiseWithTimeout)(finalPromise, timeoutInMilliseconds, timeoutMessage);
|
|
61
|
+
}
|
|
62
|
+
let error, result;
|
|
63
|
+
try {
|
|
64
|
+
result = await finalPromise;
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
if (e instanceof Error) {
|
|
68
|
+
error = e;
|
|
69
|
+
}
|
|
70
|
+
else if ((0, value_checker_1.doesHaveValue)(e)) {
|
|
71
|
+
error = util_1.default.format(e);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
error = new Error('Promise rejected without a reason');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
uncaught_exception_manager_1.default.unregisterHandler(exceptionHandler);
|
|
78
|
+
return { error, result };
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
exports.default = UserCodeRunner;
|
|
82
|
+
//# sourceMappingURL=user_code_runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user_code_runner.js","sourceRoot":"","sources":["../src/user_code_runner.ts"],"names":[],"mappings":"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","sourcesContent":["import { wrapPromiseWithTimeout } from './time'\nimport UncaughtExceptionManager from './uncaught_exception_manager'\nimport util from 'util'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IRunRequest {\n argsArray: any[]\n thisArg: any\n fn: Function\n timeoutInMilliseconds: number\n}\n\nexport interface IRunResponse {\n error?: any\n result?: any\n}\n\nconst UserCodeRunner = {\n async run({\n argsArray,\n thisArg,\n fn,\n timeoutInMilliseconds,\n }: IRunRequest): Promise<IRunResponse> {\n const callbackPromise = new Promise((resolve, reject) => {\n argsArray.push((error: Error, result: IRunResponse) => {\n if (doesHaveValue(error)) {\n reject(error)\n } else {\n resolve(result)\n }\n })\n })\n\n let fnReturn\n try {\n fnReturn = fn.apply(thisArg, argsArray)\n } catch (e) {\n const error = e instanceof Error ? e : util.format(e)\n return { error }\n }\n\n const racingPromises = []\n const callbackInterface = fn.length === argsArray.length\n const promiseInterface =\n doesHaveValue(fnReturn) && typeof fnReturn.then === 'function'\n\n if (callbackInterface && promiseInterface) {\n return {\n error: new Error(\n 'function uses multiple asynchronous interfaces: callback and promise\\n' +\n 'to use the callback interface: do not return a promise\\n' +\n 'to use the promise interface: remove the last argument to the function'\n ),\n }\n } else if (callbackInterface) {\n racingPromises.push(callbackPromise)\n } else if (promiseInterface) {\n racingPromises.push(fnReturn)\n } else {\n return { result: fnReturn }\n }\n\n let exceptionHandler\n const uncaughtExceptionPromise = new Promise((resolve, reject) => {\n exceptionHandler = reject\n UncaughtExceptionManager.registerHandler(exceptionHandler)\n })\n racingPromises.push(uncaughtExceptionPromise)\n\n let finalPromise = Promise.race(racingPromises)\n if (timeoutInMilliseconds >= 0) {\n const timeoutMessage =\n 'function timed out, ensure the ' +\n (callbackInterface ? 'callback is executed' : 'promise resolves') +\n ` within ${timeoutInMilliseconds.toString()} milliseconds`\n finalPromise = wrapPromiseWithTimeout(\n finalPromise,\n timeoutInMilliseconds,\n timeoutMessage\n )\n }\n\n let error, result\n try {\n result = await finalPromise\n } catch (e) {\n if (e instanceof Error) {\n error = e\n } else if (doesHaveValue(e)) {\n error = util.format(e)\n } else {\n error = new Error('Promise rejected without a reason')\n }\n }\n\n UncaughtExceptionManager.unregisterHandler(exceptionHandler)\n\n return { error, result }\n },\n}\n\nexport default UserCodeRunner\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.valueOrDefault = exports.doesNotHaveValue = exports.doesHaveValue = void 0;
|
|
4
|
+
function doesHaveValue(value) {
|
|
5
|
+
return !doesNotHaveValue(value);
|
|
6
|
+
}
|
|
7
|
+
exports.doesHaveValue = doesHaveValue;
|
|
8
|
+
function doesNotHaveValue(value) {
|
|
9
|
+
return value === null || value === undefined;
|
|
10
|
+
}
|
|
11
|
+
exports.doesNotHaveValue = doesNotHaveValue;
|
|
12
|
+
function valueOrDefault(value, defaultValue) {
|
|
13
|
+
if (doesHaveValue(value)) {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
return defaultValue;
|
|
17
|
+
}
|
|
18
|
+
exports.valueOrDefault = valueOrDefault;
|
|
19
|
+
//# sourceMappingURL=value_checker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value_checker.js","sourceRoot":"","sources":["../src/value_checker.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAI,KAAQ;IACvC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAFD,sCAEC;AAED,SAAgB,gBAAgB,CAAI,KAAQ;IAC1C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC;AAFD,4CAEC;AAED,SAAgB,cAAc,CAAI,KAAQ,EAAE,YAAe;IACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AALD,wCAKC","sourcesContent":["export function doesHaveValue<T>(value: T): boolean {\n return !doesNotHaveValue(value)\n}\n\nexport function doesNotHaveValue<T>(value: T): boolean {\n return value === null || value === undefined\n}\n\nexport function valueOrDefault<T>(value: T, defaultValue: T): T {\n if (doesHaveValue(value)) {\n return value\n }\n return defaultValue\n}\n"]}
|
package/lib/version.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "1.0.0-amdocs";
|
package/lib/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,cAAc,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '1.0.0-amdocs'\n"]}
|
package/lib/wrapper.mjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import cucumber from './index.js'
|
|
2
|
+
|
|
3
|
+
export const supportCodeLibraryBuilder = cucumber.supportCodeLibraryBuilder
|
|
4
|
+
export const Status = cucumber.Status
|
|
5
|
+
export const DataTable = cucumber.DataTable
|
|
6
|
+
export const TestCaseHookDefinition = cucumber.TestCaseHookDefinition
|
|
7
|
+
export const version = cucumber.version
|
|
8
|
+
|
|
9
|
+
export const Formatter = cucumber.Formatter
|
|
10
|
+
export const FormatterBuilder = cucumber.FormatterBuilder
|
|
11
|
+
export const JsonFormatter = cucumber.JsonFormatter
|
|
12
|
+
export const ProgressFormatter = cucumber.ProgressFormatter
|
|
13
|
+
export const RerunFormatter = cucumber.RerunFormatter
|
|
14
|
+
export const SnippetsFormatter = cucumber.SnippetsFormatter
|
|
15
|
+
export const SummaryFormatter = cucumber.SummaryFormatter
|
|
16
|
+
export const UsageFormatter = cucumber.UsageFormatter
|
|
17
|
+
export const UsageJsonFormatter = cucumber.UsageJsonFormatter
|
|
18
|
+
export const formatterHelpers = cucumber.formatterHelpers
|
|
19
|
+
|
|
20
|
+
export const After = cucumber.After
|
|
21
|
+
export const AfterAll = cucumber.AfterAll
|
|
22
|
+
export const AfterStep = cucumber.AfterStep
|
|
23
|
+
export const Before = cucumber.Before
|
|
24
|
+
export const BeforeAll = cucumber.BeforeAll
|
|
25
|
+
export const BeforeStep = cucumber.BeforeStep
|
|
26
|
+
export const defineStep = cucumber.defineStep
|
|
27
|
+
export const defineParameterType = cucumber.defineParameterType
|
|
28
|
+
export const Given = cucumber.Given
|
|
29
|
+
export const setDefaultTimeout = cucumber.setDefaultTimeout
|
|
30
|
+
export const setDefinitionFunctionWrapper =
|
|
31
|
+
cucumber.setDefinitionFunctionWrapper
|
|
32
|
+
export const setWorldConstructor = cucumber.setWorldConstructor
|
|
33
|
+
export const Then = cucumber.Then
|
|
34
|
+
export const When = cucumber.When
|
|
35
|
+
export const World = cucumber.World
|
|
36
|
+
export const parallelCanAssignHelpers = cucumber.parallelCanAssignHelpers
|
|
37
|
+
|
|
38
|
+
export const wrapPromiseWithTimeout = cucumber.wrapPromiseWithTimeout
|
|
39
|
+
|
|
40
|
+
// Deprecated
|
|
41
|
+
export const Cli = cucumber.Cli
|
|
42
|
+
export const parseGherkinMessageStream = cucumber.parseGherkinMessageStream
|
|
43
|
+
export const PickleFilter = cucumber.PickleFilter
|
|
44
|
+
export const Runtime = cucumber.Runtime
|
package/package.json
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dev-blinq/cucumber-js",
|
|
3
|
+
"description": "",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"testing",
|
|
6
|
+
"bdd",
|
|
7
|
+
"cucumber",
|
|
8
|
+
"gherkin",
|
|
9
|
+
"tests"
|
|
10
|
+
],
|
|
11
|
+
"version": "1.0.0-amdocs",
|
|
12
|
+
"homepage": "https://github.com/blinq-io/cucumber-js",
|
|
13
|
+
"author": "blinq.io",
|
|
14
|
+
"contributors": [
|
|
15
|
+
"blinq.io"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git@github.com:blinq-io/cucumber-js.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"email": "cukes@googlegroups.com",
|
|
23
|
+
"url": "https://github.com/blinq-io/cucumber-js/issues"
|
|
24
|
+
},
|
|
25
|
+
"directories": {
|
|
26
|
+
"lib": "./lib"
|
|
27
|
+
},
|
|
28
|
+
"main": "./lib/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"import": "./lib/wrapper.mjs",
|
|
32
|
+
"require": "./lib/index.js",
|
|
33
|
+
"types": "./lib/index.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./api": {
|
|
36
|
+
"import": "./lib/api/wrapper.mjs",
|
|
37
|
+
"require": "./lib/api/index.js",
|
|
38
|
+
"types": "./lib/api/index.d.ts"
|
|
39
|
+
},
|
|
40
|
+
"./lib/*": {
|
|
41
|
+
"require": "./lib/*.js"
|
|
42
|
+
},
|
|
43
|
+
"./package.json": "./package.json"
|
|
44
|
+
},
|
|
45
|
+
"types": "./lib/index.d.ts",
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": "14 || 16 || >=18"
|
|
48
|
+
},
|
|
49
|
+
"enginesTested": {
|
|
50
|
+
"node": "14 || 16 || 18 || 19"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@cucumber/ci-environment": "9.2.0",
|
|
54
|
+
"@cucumber/cucumber-expressions": "16.1.2",
|
|
55
|
+
"@cucumber/gherkin": "26.2.0",
|
|
56
|
+
"@cucumber/gherkin-streams": "5.0.1",
|
|
57
|
+
"@cucumber/gherkin-utils": "8.0.2",
|
|
58
|
+
"@cucumber/html-formatter": "20.4.0",
|
|
59
|
+
"@cucumber/message-streams": "4.0.1",
|
|
60
|
+
"@cucumber/messages": "22.0.0",
|
|
61
|
+
"@cucumber/tag-expressions": "5.0.1",
|
|
62
|
+
"@faker-js/faker": "^8.0.2",
|
|
63
|
+
"@types/tunnel": "^0.0.7",
|
|
64
|
+
"assertion-error-formatter": "^3.0.0",
|
|
65
|
+
"axios": "^1.6.2",
|
|
66
|
+
"capital-case": "^1.0.4",
|
|
67
|
+
"chalk": "^4.1.2",
|
|
68
|
+
"cli-table3": "0.6.3",
|
|
69
|
+
"commander": "^10.0.0",
|
|
70
|
+
"debug": "^4.3.4",
|
|
71
|
+
"error-stack-parser": "^2.1.4",
|
|
72
|
+
"figures": "^3.2.0",
|
|
73
|
+
"glob": "^7.1.6",
|
|
74
|
+
"has-ansi": "^4.0.1",
|
|
75
|
+
"indent-string": "^4.0.0",
|
|
76
|
+
"is-installed-globally": "^0.4.0",
|
|
77
|
+
"is-stream": "^2.0.0",
|
|
78
|
+
"json5": "^2.2.3",
|
|
79
|
+
"jszip": "^3.10.1",
|
|
80
|
+
"knuth-shuffle-seeded": "^1.0.6",
|
|
81
|
+
"lodash.merge": "^4.6.2",
|
|
82
|
+
"lodash.mergewith": "^4.6.2",
|
|
83
|
+
"luxon": "3.2.1",
|
|
84
|
+
"mkdirp": "^2.1.5",
|
|
85
|
+
"mz": "^2.7.0",
|
|
86
|
+
"progress": "^2.0.3",
|
|
87
|
+
"resolve-pkg": "^2.0.0",
|
|
88
|
+
"semver": "7.5.3",
|
|
89
|
+
"string-argv": "^0.3.1",
|
|
90
|
+
"strip-ansi": "6.0.1",
|
|
91
|
+
"supports-color": "^8.1.1",
|
|
92
|
+
"tmp": "^0.2.1",
|
|
93
|
+
"tmp-promise": "^3.0.3",
|
|
94
|
+
"tunnel": "^0.0.6",
|
|
95
|
+
"util-arity": "^1.1.0",
|
|
96
|
+
"verror": "^1.10.0",
|
|
97
|
+
"xmlbuilder": "^15.1.1",
|
|
98
|
+
"yaml": "^2.2.2",
|
|
99
|
+
"yup": "^0.32.11"
|
|
100
|
+
},
|
|
101
|
+
"devDependencies": {
|
|
102
|
+
"@cucumber/compatibility-kit": "^12.0.0",
|
|
103
|
+
"@cucumber/query": "12.0.1",
|
|
104
|
+
"@microsoft/api-documenter": "7.19.27",
|
|
105
|
+
"@microsoft/api-extractor": "7.33.7",
|
|
106
|
+
"@sinonjs/fake-timers": "10.0.2",
|
|
107
|
+
"@types/chai": "4.3.4",
|
|
108
|
+
"@types/chai-xml": "^0.3.2",
|
|
109
|
+
"@types/debug": "4.1.7",
|
|
110
|
+
"@types/dirty-chai": "2.0.2",
|
|
111
|
+
"@types/express": "4.17.15",
|
|
112
|
+
"@types/fs-extra": "9.0.13",
|
|
113
|
+
"@types/glob": "7.2.0",
|
|
114
|
+
"@types/has-ansi": "5.0.0",
|
|
115
|
+
"@types/lodash.merge": "4.6.7",
|
|
116
|
+
"@types/lodash.mergewith": "4.6.7",
|
|
117
|
+
"@types/luxon": "3.2.0",
|
|
118
|
+
"@types/mocha": "10.0.1",
|
|
119
|
+
"@types/mustache": "4.2.2",
|
|
120
|
+
"@types/mz": "2.7.4",
|
|
121
|
+
"@types/node": "18.11.18",
|
|
122
|
+
"@types/progress": "2.0.5",
|
|
123
|
+
"@types/semver": "7.5.0",
|
|
124
|
+
"@types/sinon-chai": "3.2.9",
|
|
125
|
+
"@types/sinonjs__fake-timers": "8.1.2",
|
|
126
|
+
"@types/stream-buffers": "3.0.4",
|
|
127
|
+
"@types/tmp": "0.2.3",
|
|
128
|
+
"@types/verror": "1.10.6",
|
|
129
|
+
"@typescript-eslint/eslint-plugin": "5.48.0",
|
|
130
|
+
"@typescript-eslint/parser": "5.48.0",
|
|
131
|
+
"chai": "4.3.7",
|
|
132
|
+
"chai-exclude": "2.1.0",
|
|
133
|
+
"chai-xml": "^0.4.1",
|
|
134
|
+
"coffeescript": "2.7.0",
|
|
135
|
+
"dependency-lint": "7.1.0",
|
|
136
|
+
"dirty-chai": "2.0.1",
|
|
137
|
+
"eslint": "8.31.0",
|
|
138
|
+
"eslint-config-prettier": "8.6.0",
|
|
139
|
+
"eslint-plugin-import": "2.26.0",
|
|
140
|
+
"eslint-plugin-node": "11.1.0",
|
|
141
|
+
"eslint-plugin-standard": "4.1.0",
|
|
142
|
+
"express": "4.18.2",
|
|
143
|
+
"fs-extra": "10.1.0",
|
|
144
|
+
"genversion": "3.1.1",
|
|
145
|
+
"mocha": "10.2.0",
|
|
146
|
+
"mustache": "4.2.0",
|
|
147
|
+
"nyc": "15.1.0",
|
|
148
|
+
"prettier": "2.8.1",
|
|
149
|
+
"reindent-template-literals": "1.1.0",
|
|
150
|
+
"shx": "0.3.4",
|
|
151
|
+
"sinon": "15.0.1",
|
|
152
|
+
"sinon-chai": "3.7.0",
|
|
153
|
+
"stream-buffers": "3.0.2",
|
|
154
|
+
"stream-to-string": "1.2.0",
|
|
155
|
+
"ts-node": "10.9.1",
|
|
156
|
+
"tsd": "0.25.0",
|
|
157
|
+
"typescript": "4.9.4"
|
|
158
|
+
},
|
|
159
|
+
"overrides": {
|
|
160
|
+
"ansi-regex": "^5.0.1"
|
|
161
|
+
},
|
|
162
|
+
"scripts": {
|
|
163
|
+
"build-local": "genversion --es6 src/version.ts && tsc --build tsconfig.node.json && shx cp src/importer.js lib/ && shx cp src/wrapper.mjs lib/ && shx cp src/api/wrapper.mjs lib/api/",
|
|
164
|
+
"cck-test": "mocha 'compatibility/**/*_spec.ts'",
|
|
165
|
+
"docs:ci": "api-extractor run --verbose",
|
|
166
|
+
"docs:local": "api-extractor run --verbose --local && api-documenter markdown --input-folder ./tmp/api-extractor --output-folder ./docs/api",
|
|
167
|
+
"feature-test": "node bin/cucumber.js",
|
|
168
|
+
"lint-code-autofix": "eslint --fix \"{compatibility,example,features,scripts,src,test}/**/*.ts\"",
|
|
169
|
+
"lint-code": "eslint \"{compatibility,example,features,scripts,src,test}/**/*.ts\"",
|
|
170
|
+
"lint-dependencies": "dependency-lint",
|
|
171
|
+
"lint-format-autofix": "prettier --write .",
|
|
172
|
+
"lint-format": "prettier --check .",
|
|
173
|
+
"lint": "npm run lint-code && npm run lint-format && npm run lint-dependencies",
|
|
174
|
+
"prelint-autofix": "npm run build-local",
|
|
175
|
+
"prelint-code": "npm run build-local",
|
|
176
|
+
"precck-test": "npm run build-local",
|
|
177
|
+
"prefeature-test": "npm run build-local",
|
|
178
|
+
"prepublishOnly": "shx rm -rf lib && npm run build-local",
|
|
179
|
+
"pretest-coverage": "npm run build-local",
|
|
180
|
+
"pretypes-test": "npm run build-local",
|
|
181
|
+
"test-coverage": "nyc --silent mocha 'src/**/*_spec.ts' 'compatibility/**/*_spec.ts' && nyc --silent --no-clean node bin/cucumber.js --tags \"not @source-mapping\" && nyc report --reporter=lcov",
|
|
182
|
+
"test": "npm run types-test && npm run unit-test && npm run cck-test && npm run feature-test",
|
|
183
|
+
"types-test": "tsd",
|
|
184
|
+
"unit-test": "mocha 'src/**/*_spec.ts'",
|
|
185
|
+
"update-dependencies": "npx npm-check-updates --upgrade"
|
|
186
|
+
},
|
|
187
|
+
"bin": {
|
|
188
|
+
"cucumber-js": "bin/cucumber.js",
|
|
189
|
+
"download-install": "bin/download-install.js"
|
|
190
|
+
},
|
|
191
|
+
"license": "MIT",
|
|
192
|
+
"files": [
|
|
193
|
+
"api/",
|
|
194
|
+
"bin/",
|
|
195
|
+
"lib/"
|
|
196
|
+
]
|
|
197
|
+
}
|