@cucumber/cucumber 11.1.1 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/lib/api/convert_configuration.d.ts +1 -2
- package/lib/api/convert_configuration.js +1 -2
- package/lib/api/convert_configuration.js.map +1 -1
- package/lib/api/formatters.d.ts +1 -3
- package/lib/api/formatters.js +2 -3
- package/lib/api/formatters.js.map +1 -1
- package/lib/api/gherkin.js +1 -2
- package/lib/api/gherkin.js.map +1 -1
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js.map +1 -1
- package/lib/api/load_configuration.d.ts +2 -1
- package/lib/api/load_configuration.js +3 -4
- package/lib/api/load_configuration.js.map +1 -1
- package/lib/api/load_sources.d.ts +2 -1
- package/lib/api/load_sources.js +4 -5
- package/lib/api/load_sources.js.map +1 -1
- package/lib/api/load_support.d.ts +2 -1
- package/lib/api/load_support.js +4 -5
- package/lib/api/load_support.js.map +1 -1
- package/lib/api/plugins.d.ts +5 -5
- package/lib/api/plugins.js +12 -13
- package/lib/api/plugins.js.map +1 -1
- package/lib/api/run_cucumber.d.ts +2 -1
- package/lib/api/run_cucumber.js +4 -5
- package/lib/api/run_cucumber.js.map +1 -1
- package/lib/api/support.d.ts +1 -1
- package/lib/api/support.js +1 -2
- package/lib/api/support.js.map +1 -1
- package/lib/api/test_helpers.d.ts +1 -1
- package/lib/api/test_helpers.js +2 -3
- package/lib/api/test_helpers.js.map +1 -1
- package/lib/api/types.d.ts +0 -35
- package/lib/api/types.js.map +1 -1
- package/lib/assemble/assemble_test_cases.d.ts +1 -7
- package/lib/assemble/assemble_test_cases.js +3 -3
- package/lib/assemble/assemble_test_cases.js.map +1 -1
- package/lib/cli/helpers.d.ts +1 -3
- package/lib/cli/helpers.js +61 -33
- package/lib/cli/helpers.js.map +1 -1
- package/lib/cli/i18n.js +2 -3
- package/lib/cli/i18n.js.map +1 -1
- package/lib/cli/index.d.ts +0 -1
- package/lib/cli/index.js.map +1 -1
- package/lib/cli/install_validator.js +1 -2
- package/lib/cli/install_validator.js.map +1 -1
- package/lib/cli/run.js +1 -1
- package/lib/cli/run.js.map +1 -1
- package/lib/cli/validate_node_engine_version.js +1 -2
- package/lib/cli/validate_node_engine_version.js.map +1 -1
- package/lib/configuration/argv_parser.js.map +1 -1
- package/lib/configuration/check_schema.js +18 -9
- package/lib/configuration/check_schema.js.map +1 -1
- package/lib/configuration/from_file.d.ts +1 -1
- package/lib/configuration/from_file.js +3 -4
- package/lib/configuration/from_file.js.map +1 -1
- package/lib/configuration/helpers.js +1 -2
- package/lib/configuration/helpers.js.map +1 -1
- package/lib/configuration/locate_file.js +1 -2
- package/lib/configuration/locate_file.js.map +1 -1
- package/lib/configuration/merge_configurations.js +1 -2
- package/lib/configuration/merge_configurations.js.map +1 -1
- package/lib/configuration/parse_configuration.d.ts +1 -1
- package/lib/configuration/parse_configuration.js +1 -2
- package/lib/configuration/parse_configuration.js.map +1 -1
- package/lib/configuration/split_format_descriptor.d.ts +1 -1
- package/lib/configuration/split_format_descriptor.js +1 -2
- package/lib/configuration/split_format_descriptor.js.map +1 -1
- package/lib/configuration/validate_configuration.d.ts +1 -1
- package/lib/configuration/validate_configuration.js +1 -2
- package/lib/configuration/validate_configuration.js.map +1 -1
- package/lib/environment/console_logger.d.ts +11 -0
- package/lib/{api → environment}/console_logger.js +6 -6
- package/lib/environment/console_logger.js.map +1 -0
- package/lib/environment/index.d.ts +2 -0
- package/lib/environment/index.js +19 -0
- package/lib/environment/index.js.map +1 -0
- package/lib/environment/make_environment.d.ts +2 -0
- package/lib/{api/environment.js → environment/make_environment.js} +3 -4
- package/lib/environment/make_environment.js.map +1 -0
- package/lib/environment/types.d.ts +41 -0
- package/lib/{logger.js → environment/types.js} +1 -1
- package/lib/environment/types.js.map +1 -0
- package/lib/filter_stack_trace.js +2 -3
- package/lib/filter_stack_trace.js.map +1 -1
- package/lib/formatter/builder.d.ts +1 -5
- package/lib/formatter/builder.js.map +1 -1
- package/lib/formatter/builtin/html.js +1 -4
- package/lib/formatter/builtin/html.js.map +1 -1
- package/lib/formatter/builtin/index.d.ts +1 -1
- package/lib/formatter/create_stream.d.ts +1 -2
- package/lib/formatter/create_stream.js +1 -2
- package/lib/formatter/create_stream.js.map +1 -1
- package/lib/formatter/find_class_or_plugin.js +1 -2
- package/lib/formatter/find_class_or_plugin.js.map +1 -1
- package/lib/formatter/get_color_fns.d.ts +0 -2
- package/lib/formatter/get_color_fns.js +1 -1
- package/lib/formatter/get_color_fns.js.map +1 -1
- package/lib/formatter/helpers/duration_helpers.js +2 -3
- package/lib/formatter/helpers/duration_helpers.js.map +1 -1
- package/lib/formatter/helpers/event_data_collector.d.ts +0 -1
- package/lib/formatter/helpers/event_data_collector.js +17 -7
- package/lib/formatter/helpers/event_data_collector.js.map +1 -1
- package/lib/formatter/helpers/gherkin_document_parser.js +4 -5
- package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -1
- package/lib/formatter/helpers/index.js +17 -7
- package/lib/formatter/helpers/index.js.map +1 -1
- package/lib/formatter/helpers/issue_helpers.js +6 -7
- package/lib/formatter/helpers/issue_helpers.js.map +1 -1
- package/lib/formatter/helpers/keyword_type.js +3 -3
- package/lib/formatter/helpers/keyword_type.js.map +1 -1
- package/lib/formatter/helpers/location_helpers.js +1 -2
- package/lib/formatter/helpers/location_helpers.js.map +1 -1
- package/lib/formatter/helpers/pickle_parser.js +4 -5
- package/lib/formatter/helpers/pickle_parser.js.map +1 -1
- package/lib/formatter/helpers/step_argument_formatter.js +1 -2
- package/lib/formatter/helpers/step_argument_formatter.js.map +1 -1
- package/lib/formatter/helpers/summary_helpers.js +18 -9
- package/lib/formatter/helpers/summary_helpers.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_formatter.js +18 -9
- package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_parser.js +18 -9
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
- package/lib/formatter/helpers/usage_helpers/index.js +18 -9
- package/lib/formatter/helpers/usage_helpers/index.js.map +1 -1
- package/lib/formatter/import_code.js +1 -2
- package/lib/formatter/import_code.js.map +1 -1
- package/lib/formatter/index.d.ts +0 -2
- package/lib/formatter/json_formatter.js +17 -7
- package/lib/formatter/json_formatter.js.map +1 -1
- package/lib/formatter/progress_bar_formatter.js.map +1 -1
- package/lib/formatter/progress_formatter.js +17 -7
- package/lib/formatter/progress_formatter.js.map +1 -1
- package/lib/formatter/rerun_formatter.js +17 -7
- package/lib/formatter/rerun_formatter.js.map +1 -1
- package/lib/formatter/resolve_implementation.js +1 -2
- package/lib/formatter/resolve_implementation.js.map +1 -1
- package/lib/formatter/snippets_formatter.js +17 -7
- package/lib/formatter/snippets_formatter.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js +1 -1
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -1
- package/lib/formatter/summary_formatter.js.map +1 -1
- package/lib/formatter/usage_formatter.js +17 -7
- package/lib/formatter/usage_formatter.js.map +1 -1
- package/lib/formatter/usage_json_formatter.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +17 -7
- package/lib/index.js.map +1 -1
- package/lib/models/data_table.js.map +1 -1
- package/lib/models/step_definition.js.map +1 -1
- package/lib/paths/paths.d.ts +1 -1
- package/lib/paths/paths.js +1 -2
- package/lib/paths/paths.js.map +1 -1
- package/lib/pickle_filter.js.map +1 -1
- package/lib/plugin/plugin_manager.d.ts +5 -4
- package/lib/plugin/plugin_manager.js +14 -6
- package/lib/plugin/plugin_manager.js.map +1 -1
- package/lib/plugin/types.d.ts +4 -3
- package/lib/plugin/types.js.map +1 -1
- package/lib/publish/publish_plugin.js +46 -16
- package/lib/publish/publish_plugin.js.map +1 -1
- package/lib/runtime/attachment_manager/index.d.ts +0 -2
- package/lib/runtime/attachment_manager/index.js +17 -7
- package/lib/runtime/attachment_manager/index.js.map +1 -1
- package/lib/runtime/coordinator.d.ts +0 -1
- package/lib/runtime/coordinator.js +4 -6
- package/lib/runtime/coordinator.js.map +1 -1
- package/lib/runtime/format_error.js +1 -2
- package/lib/runtime/format_error.js.map +1 -1
- package/lib/runtime/helpers.js +20 -11
- package/lib/runtime/helpers.js.map +1 -1
- package/lib/runtime/make_runtime.d.ts +3 -3
- package/lib/runtime/make_runtime.js +1 -2
- package/lib/runtime/make_runtime.js.map +1 -1
- package/lib/runtime/parallel/adapter.d.ts +2 -4
- package/lib/runtime/parallel/adapter.js.map +1 -1
- package/lib/runtime/parallel/run_worker.js.map +1 -1
- package/lib/runtime/parallel/worker.js.map +1 -1
- package/lib/runtime/run_test_run_hooks.js.map +1 -1
- package/lib/runtime/scope/make_proxy.js +1 -2
- package/lib/runtime/scope/make_proxy.js.map +1 -1
- package/lib/runtime/scope/test_case_scope.js +2 -2
- package/lib/runtime/scope/test_case_scope.js.map +1 -1
- package/lib/runtime/scope/test_run_scope.js +2 -2
- package/lib/runtime/scope/test_run_scope.js.map +1 -1
- package/lib/runtime/serial/adapter.d.ts +0 -1
- package/lib/runtime/serial/adapter.js.map +1 -1
- package/lib/runtime/step_runner.js +24 -13
- package/lib/runtime/step_runner.js.map +1 -1
- package/lib/runtime/stopwatch.js.map +1 -1
- package/lib/runtime/test_case_runner.d.ts +0 -1
- package/lib/runtime/test_case_runner.js +17 -7
- package/lib/runtime/test_case_runner.js.map +1 -1
- package/lib/runtime/worker.d.ts +0 -1
- package/lib/runtime/worker.js.map +1 -1
- package/lib/step_arguments.js +1 -2
- package/lib/step_arguments.js.map +1 -1
- package/lib/support_code_library_builder/build_parameter_type.js +1 -2
- package/lib/support_code_library_builder/build_parameter_type.js.map +1 -1
- package/lib/support_code_library_builder/get_definition_line_and_uri.js +1 -2
- package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +1 -1
- package/lib/support_code_library_builder/index.js.map +1 -1
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js +1 -2
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js.map +1 -1
- package/lib/support_code_library_builder/validate_arguments.js +1 -1
- package/lib/support_code_library_builder/validate_arguments.js.map +1 -1
- package/lib/time.d.ts +0 -2
- package/lib/time.js +19 -10
- package/lib/time.js.map +1 -1
- package/lib/try_require.js +1 -1
- package/lib/try_require.js.map +1 -1
- package/lib/tsconfig.node.tsbuildinfo +1 -0
- package/lib/uncaught_exception_manager.d.ts +0 -1
- package/lib/user_code_runner.js.map +1 -1
- package/lib/value_checker.js +3 -4
- package/lib/value_checker.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +53 -55
- package/lib/api/console_logger.d.ts +0 -12
- package/lib/api/console_logger.js.map +0 -1
- package/lib/api/environment.d.ts +0 -7
- package/lib/api/environment.js.map +0 -1
- package/lib/logger.d.ts +0 -5
- package/lib/logger.js.map +0 -1
- package/lib/publish/http_stream.d.ts +0 -30
- package/lib/publish/http_stream.js +0 -117
- package/lib/publish/http_stream.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argv_parser.js","sourceRoot":"","sources":["../../src/configuration/argv_parser.ts"],"names":[],"mappings":";;;;;AAAA,yCAAmC;AACnC,gEAAgC;AAChC,+CAA4C;AAC5C,wCAAoC;AACpC,kDAAoD;AAkBpD,MAAM,UAAU,GAAG;IACjB,OAAO,CAAI,GAAM,EAAE,OAAY,EAAE;QAC/B,IAAI,GAAG,EAAE;YACP,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAA;SACtB;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,OAAO,UAAU,GAAW,EAAE,OAAe,EAAE;YAC7C,IAAI,GAAW,CAAA;YACf,IAAI;gBACF,GAAG,GAA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D,aAAa;SACd,CAAA;IACH,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import { Command } from 'commander'\nimport merge from 'lodash.merge'\nimport { dialects } from '@cucumber/gherkin'\nimport { version } from '../version'\nimport { documentation } from '../formatter/builtin'\nimport { IConfiguration } from './types'\n\nexport interface IParsedArgvOptions {\n config?: string\n i18nKeywords?: string\n i18nLanguages?: boolean\n profile: string[]\n}\n\nexport interface IParsedArgv {\n options: IParsedArgvOptions\n configuration: Partial<IConfiguration>\n}\n\ntype IRawArgvOptions = Partial<Omit<IConfiguration, 'paths'>> &\n IParsedArgvOptions\n\nconst ArgvParser = {\n collect<T>(val: T, memo: T[] = []): T[] {\n if (val) {\n return [...memo, val]\n }\n return undefined\n },\n\n mergeJson(option: string): (str: string, memo?: object) => object {\n return function (str: string, memo: object = {}) {\n let val: object\n try {\n val = JSON.parse(str)\n } catch (error) {\n const e: Error = error\n throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`)\n }\n if (typeof val !== 'object' || Array.isArray(val)) {\n throw new Error(`${option} must be passed JSON of an object: ${str}`)\n }\n return merge(memo, val)\n }\n },\n\n mergeTags(value: string, memo?: string): string {\n return memo ? `${memo} and (${value})` : `(${value})`\n },\n\n validateCountOption(value: string, optionName: string): number {\n const numericValue = parseInt(value)\n if (isNaN(numericValue) || numericValue < 0) {\n throw new Error(`${optionName} must be a non negative integer`)\n }\n return numericValue\n },\n\n validateLanguage(value: string): string {\n if (!Object.keys(dialects).includes(value)) {\n throw new Error(`Unsupported ISO 639-1: ${value}`)\n }\n return value\n },\n\n parse(argv: string[]): IParsedArgv {\n const program = new Command('cucumber-js')\n\n program\n .storeOptionsAsProperties(false)\n .usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')\n .version(version, '-v, --version')\n .option('-b, --backtrace', 'show full backtrace for errors')\n .option('-c, --config <PATH>', 'specify configuration file')\n .option('-d, --dry-run', 'invoke formatters without executing steps')\n .option(\n '--exit, --force-exit',\n 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit'\n )\n .option('--fail-fast', 'abort the run on first failure')\n .option(\n '-f, --format <TYPE[:PATH]>',\n 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\\n' +\n Object.entries(documentation).reduce(\n (previous, [key, description]) =>\n previous + ` ${key}: ${description}\\n`,\n ''\n ),\n ArgvParser.collect\n )\n .option(\n '--format-options <JSON>',\n 'provide options for formatters (repeatable)',\n ArgvParser.mergeJson('--format-options')\n )\n .option(\n '--i18n-keywords <ISO 639-1>',\n 'list language keywords',\n ArgvParser.validateLanguage\n )\n .option('--i18n-languages', 'list languages')\n .option(\n '-i, --import <GLOB|DIR|FILE>',\n 'import files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '-l, --loader <NODE_MODULE>',\n 'module specifier(s) for loaders to be registered ahead of loading support code',\n ArgvParser.collect\n )\n .option(\n '--language <ISO 639-1>',\n 'provide the default language for feature files'\n )\n .option(\n '--name <REGEXP>',\n 'only execute the scenarios with name matching the expression (repeatable)',\n ArgvParser.collect\n )\n\n .option(\n '--order <TYPE[:SEED]>',\n 'run scenarios in the specified order. Type should be `defined` or `random`'\n )\n .option(\n '-p, --profile <NAME>',\n 'specify the profile to use (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--parallel <NUMBER_OF_WORKERS>',\n 'run in parallel with the given number of workers',\n (val) => ArgvParser.validateCountOption(val, '--parallel')\n )\n .option('--publish', 'Publish a report to https://reports.cucumber.io')\n .option(\n '--publish-quiet',\n \"Don't print information banner about publishing reports\"\n )\n .option(\n '-r, --require <GLOB|DIR|FILE>',\n 'require files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--require-module <NODE_MODULE>',\n 'require node modules before requiring files (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--retry <NUMBER_OF_RETRIES>',\n 'specify the number of times to retry failing test cases (default: 0)',\n (val) => ArgvParser.validateCountOption(val, '--retry')\n )\n .option(\n '--retry-tag-filter <EXPRESSION>',\n `only retries the features or scenarios with tags matching the expression (repeatable).\n This option requires '--retry' to be specified.`,\n ArgvParser.mergeTags\n )\n .option('--strict', 'fail if there are pending steps')\n .option('--no-strict', 'succeed even if there are pending steps')\n .option(\n '-t, --tags <EXPRESSION>',\n 'only execute the features or scenarios with tags matching the expression (repeatable)',\n ArgvParser.mergeTags\n )\n .option(\n '--world-parameters <JSON>',\n 'provide parameters that will be passed to the world constructor (repeatable)',\n ArgvParser.mergeJson('--world-parameters')\n )\n\n program.addHelpText(\n 'afterAll',\n 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md'\n )\n\n program.parse(argv)\n const {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n ...regularStuff\n }: IRawArgvOptions = program.opts()\n const configuration: Partial<IConfiguration> = regularStuff\n if (program.args.length > 0) {\n configuration.paths = program.args\n }\n\n return {\n options: {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n },\n configuration,\n }\n },\n}\n\nexport default ArgvParser\n"]}
|
|
1
|
+
{"version":3,"file":"argv_parser.js","sourceRoot":"","sources":["../../src/configuration/argv_parser.ts"],"names":[],"mappings":";;;;;AAAA,yCAAmC;AACnC,gEAAgC;AAChC,+CAA4C;AAC5C,wCAAoC;AACpC,kDAAoD;AAkBpD,MAAM,UAAU,GAAG;IACjB,OAAO,CAAI,GAAM,EAAE,OAAY,EAAE;QAC/B,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,OAAO,UAAU,GAAW,EAAE,OAAe,EAAE;YAC7C,IAAI,GAAW,CAAA;YACf,IAAI,CAAC;gBACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,GAAU,KAAK,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e,UAAU,CAAA","sourcesContent":["import { Command } from 'commander'\nimport merge from 'lodash.merge'\nimport { dialects } from '@cucumber/gherkin'\nimport { version } from '../version'\nimport { documentation } from '../formatter/builtin'\nimport { IConfiguration } from './types'\n\nexport interface IParsedArgvOptions {\n config?: string\n i18nKeywords?: string\n i18nLanguages?: boolean\n profile: string[]\n}\n\nexport interface IParsedArgv {\n options: IParsedArgvOptions\n configuration: Partial<IConfiguration>\n}\n\ntype IRawArgvOptions = Partial<Omit<IConfiguration, 'paths'>> &\n IParsedArgvOptions\n\nconst ArgvParser = {\n collect<T>(val: T, memo: T[] = []): T[] {\n if (val) {\n return [...memo, val]\n }\n return undefined\n },\n\n mergeJson(option: string): (str: string, memo?: object) => object {\n return function (str: string, memo: object = {}) {\n let val: object\n try {\n val = JSON.parse(str)\n } catch (error) {\n const e: Error = error\n throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`)\n }\n if (typeof val !== 'object' || Array.isArray(val)) {\n throw new Error(`${option} must be passed JSON of an object: ${str}`)\n }\n return merge(memo, val)\n }\n },\n\n mergeTags(value: string, memo?: string): string {\n return memo ? `${memo} and (${value})` : `(${value})`\n },\n\n validateCountOption(value: string, optionName: string): number {\n const numericValue = parseInt(value)\n if (isNaN(numericValue) || numericValue < 0) {\n throw new Error(`${optionName} must be a non negative integer`)\n }\n return numericValue\n },\n\n validateLanguage(value: string): string {\n if (!Object.keys(dialects).includes(value)) {\n throw new Error(`Unsupported ISO 639-1: ${value}`)\n }\n return value\n },\n\n parse(argv: string[]): IParsedArgv {\n const program = new Command('cucumber-js')\n\n program\n .storeOptionsAsProperties(false)\n .usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')\n .version(version, '-v, --version')\n .option('-b, --backtrace', 'show full backtrace for errors')\n .option('-c, --config <PATH>', 'specify configuration file')\n .option('-d, --dry-run', 'invoke formatters without executing steps')\n .option(\n '--exit, --force-exit',\n 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit'\n )\n .option('--fail-fast', 'abort the run on first failure')\n .option(\n '-f, --format <TYPE[:PATH]>',\n 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\\n' +\n Object.entries(documentation).reduce(\n (previous, [key, description]) =>\n previous + ` ${key}: ${description}\\n`,\n ''\n ),\n ArgvParser.collect\n )\n .option(\n '--format-options <JSON>',\n 'provide options for formatters (repeatable)',\n ArgvParser.mergeJson('--format-options')\n )\n .option(\n '--i18n-keywords <ISO 639-1>',\n 'list language keywords',\n ArgvParser.validateLanguage\n )\n .option('--i18n-languages', 'list languages')\n .option(\n '-i, --import <GLOB|DIR|FILE>',\n 'import files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '-l, --loader <NODE_MODULE>',\n 'module specifier(s) for loaders to be registered ahead of loading support code',\n ArgvParser.collect\n )\n .option(\n '--language <ISO 639-1>',\n 'provide the default language for feature files'\n )\n .option(\n '--name <REGEXP>',\n 'only execute the scenarios with name matching the expression (repeatable)',\n ArgvParser.collect\n )\n\n .option(\n '--order <TYPE[:SEED]>',\n 'run scenarios in the specified order. Type should be `defined` or `random`'\n )\n .option(\n '-p, --profile <NAME>',\n 'specify the profile to use (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--parallel <NUMBER_OF_WORKERS>',\n 'run in parallel with the given number of workers',\n (val) => ArgvParser.validateCountOption(val, '--parallel')\n )\n .option('--publish', 'Publish a report to https://reports.cucumber.io')\n .option(\n '--publish-quiet',\n \"Don't print information banner about publishing reports\"\n )\n .option(\n '-r, --require <GLOB|DIR|FILE>',\n 'require files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--require-module <NODE_MODULE>',\n 'require node modules before requiring files (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--retry <NUMBER_OF_RETRIES>',\n 'specify the number of times to retry failing test cases (default: 0)',\n (val) => ArgvParser.validateCountOption(val, '--retry')\n )\n .option(\n '--retry-tag-filter <EXPRESSION>',\n `only retries the features or scenarios with tags matching the expression (repeatable).\n This option requires '--retry' to be specified.`,\n ArgvParser.mergeTags\n )\n .option('--strict', 'fail if there are pending steps')\n .option('--no-strict', 'succeed even if there are pending steps')\n .option(\n '-t, --tags <EXPRESSION>',\n 'only execute the features or scenarios with tags matching the expression (repeatable)',\n ArgvParser.mergeTags\n )\n .option(\n '--world-parameters <JSON>',\n 'provide parameters that will be passed to the world constructor (repeatable)',\n ArgvParser.mergeJson('--world-parameters')\n )\n\n program.addHelpText(\n 'afterAll',\n 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md'\n )\n\n program.parse(argv)\n const {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n ...regularStuff\n }: IRawArgvOptions = program.opts()\n const configuration: Partial<IConfiguration> = regularStuff\n if (program.args.length > 0) {\n configuration.paths = program.args\n }\n\n return {\n options: {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n },\n configuration,\n }\n },\n}\n\nexport default ArgvParser\n"]}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.checkSchema =
|
|
36
|
+
exports.checkSchema = checkSchema;
|
|
27
37
|
const yup = __importStar(require("yup"));
|
|
28
38
|
const gherkin_1 = require("@cucumber/gherkin");
|
|
29
39
|
const schema = yup.object().shape({
|
|
@@ -60,5 +70,4 @@ function checkSchema(configuration) {
|
|
|
60
70
|
stripUnknown: true,
|
|
61
71
|
});
|
|
62
72
|
}
|
|
63
|
-
exports.checkSchema = checkSchema;
|
|
64
73
|
//# sourceMappingURL=check_schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check_schema.js","sourceRoot":"","sources":["../../src/configuration/check_schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check_schema.js","sourceRoot":"","sources":["../../src/configuration/check_schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,kCAMC;AA1CD,yCAA0B;AAC1B,+CAA4C;AAG5C,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;IAChC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE;IACxB,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE;IACrB,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE;IACvB,MAAM,EAAE,GAAG;SACR,KAAK,EAAE;SACP,EAAE,CACD,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAChB,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC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AC,aAAkB;IAC5C,OAAO,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE;QACxC,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;KACnB,CAA4B,CAAA;AAC/B,CAAC","sourcesContent":["import * as yup from 'yup'\nimport { dialects } from '@cucumber/gherkin'\nimport { IConfiguration } from './types'\n\nconst schema = yup.object().shape({\n backtrace: yup.boolean(),\n dryRun: yup.boolean(),\n exit: yup.boolean(),\n failFast: yup.boolean(),\n format: yup\n .array()\n .of(\n yup.lazy((val) =>\n Array.isArray(val)\n ? yup.array().of(yup.string()).min(1).max(2)\n : yup.string()\n )\n ),\n formatOptions: yup.object(),\n import: yup.array().of(yup.string()),\n language: yup.string().oneOf(Object.keys(dialects)),\n name: yup.array().of(yup.string()),\n order: yup.string().matches(/^random:.*|random|defined$/),\n paths: yup.array().of(yup.string()),\n parallel: yup.number().integer().min(0),\n publish: yup.boolean(),\n publishQuiet: yup.boolean(),\n require: yup.array().of(yup.string()),\n requireModule: yup.array().of(yup.string()),\n retry: yup.number().integer().min(0),\n retryTagFilter: yup.string(),\n strict: yup.boolean(),\n tags: yup.string(),\n worldParameters: yup.object(),\n})\n\nexport function checkSchema(configuration: any): Partial<IConfiguration> {\n return schema.validateSync(configuration, {\n abortEarly: false,\n strict: true,\n stripUnknown: true,\n }) as Partial<IConfiguration>\n}\n"]}
|
|
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fromFile =
|
|
6
|
+
exports.fromFile = fromFile;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const node_util_1 = require("node:util");
|
|
10
10
|
const node_url_1 = require("node:url");
|
|
11
11
|
const yaml_1 = __importDefault(require("yaml"));
|
|
12
|
-
const read_pkg_up_1 = __importDefault(require("read-pkg-up"));
|
|
13
12
|
const merge_configurations_1 = require("./merge_configurations");
|
|
14
13
|
const parse_configuration_1 = require("./parse_configuration");
|
|
15
14
|
async function fromFile(logger, cwd, file, profiles = []) {
|
|
@@ -37,7 +36,6 @@ async function fromFile(logger, cwd, file, profiles = []) {
|
|
|
37
36
|
});
|
|
38
37
|
return (0, merge_configurations_1.mergeConfigurations)({}, ...profiles.map((profileKey) => (0, parse_configuration_1.parseConfiguration)(logger, `Profile "${profileKey}"`, definitions[profileKey])));
|
|
39
38
|
}
|
|
40
|
-
exports.fromFile = fromFile;
|
|
41
39
|
async function handleDefaultFunctionDefinition(definitions, defaultDefinition) {
|
|
42
40
|
if (Object.keys(definitions).length > 1) {
|
|
43
41
|
throw new Error('Invalid profiles specified: if a default function definition is provided, no other static profiles should be specified');
|
|
@@ -97,7 +95,8 @@ async function loadFile(logger, cwd, file) {
|
|
|
97
95
|
return definitions;
|
|
98
96
|
}
|
|
99
97
|
async function readPackageJson(filePath) {
|
|
100
|
-
const
|
|
98
|
+
const { readPackageUp } = await import('read-package-up');
|
|
99
|
+
const parentPackage = await readPackageUp({ cwd: node_path_1.default.dirname(filePath) });
|
|
101
100
|
return parentPackage?.packageJson;
|
|
102
101
|
}
|
|
103
102
|
//# sourceMappingURL=from_file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from_file.js","sourceRoot":"","sources":["../../src/configuration/from_file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"from_file.js","sourceRoot":"","sources":["../../src/configuration/from_file.ts"],"names":[],"mappings":";;;;;AAUA,4BA4CC;AAtDD,sDAAwB;AACxB,0DAA4B;AAC5B,yCAAqC;AACrC,uCAAwC;AACxC,gDAAuB;AAGvB,iEAA4D;AAC5D,+DAA0D;AAEnD,KAAK,UAAU,QAAQ,CAC5B,MAAe,EACf,GAAW,EACX,IAAY,E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,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\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 let definitions\n switch (extension) {\n case '.json':\n definitions = JSON.parse(\n await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })\n )\n break\n case '.yaml':\n case '.yml':\n definitions = YAML.parse(\n await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })\n )\n break\n case '.cjs':\n logger.debug(\n `Loading configuration file \"${file}\" as CommonJS based on extension`\n )\n // eslint-disable-next-line @typescript-eslint/no-var-requires\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 '.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-var-requires\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-var-requires\n definitions = require(filePath)\n }\n }\n break\n default:\n throw new Error(`Unsupported configuration file extension \"${extension}\"`)\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,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTruthyString =
|
|
3
|
+
exports.isTruthyString = isTruthyString;
|
|
4
4
|
function isTruthyString(s) {
|
|
5
5
|
if (s === undefined) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
8
8
|
return s.match(/^(false|no|0)$/i) === null;
|
|
9
9
|
}
|
|
10
|
-
exports.isTruthyString = isTruthyString;
|
|
11
10
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/configuration/helpers.ts"],"names":[],"mappings":"
|
|
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"]}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.locateFile =
|
|
6
|
+
exports.locateFile = locateFile;
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
8
|
const fs_1 = __importDefault(require("mz/fs"));
|
|
9
9
|
const DEFAULT_FILENAMES = [
|
|
@@ -17,5 +17,4 @@ const DEFAULT_FILENAMES = [
|
|
|
17
17
|
function locateFile(cwd) {
|
|
18
18
|
return DEFAULT_FILENAMES.find((filename) => fs_1.default.existsSync(node_path_1.default.join(cwd, filename)));
|
|
19
19
|
}
|
|
20
|
-
exports.locateFile = locateFile;
|
|
21
20
|
//# sourceMappingURL=locate_file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locate_file.js","sourceRoot":"","sources":["../../src/configuration/locate_file.ts"],"names":[],"mappings":"
|
|
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"]}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.mergeConfigurations =
|
|
6
|
+
exports.mergeConfigurations = mergeConfigurations;
|
|
7
7
|
const lodash_mergewith_1 = __importDefault(require("lodash.mergewith"));
|
|
8
8
|
const ADDITIVE_ARRAYS = [
|
|
9
9
|
'format',
|
|
@@ -45,5 +45,4 @@ function customizer(objValue, srcValue, key) {
|
|
|
45
45
|
function mergeConfigurations(source, ...configurations) {
|
|
46
46
|
return (0, lodash_mergewith_1.default)({}, source, ...configurations, customizer);
|
|
47
47
|
}
|
|
48
|
-
exports.mergeConfigurations = mergeConfigurations;
|
|
49
48
|
//# sourceMappingURL=merge_configurations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge_configurations.js","sourceRoot":"","sources":["../../src/configuration/merge_configurations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge_configurations.js","sourceRoot":"","sources":["../../src/configuration/merge_configurations.ts"],"names":[],"mappings":";;;;;AA6CA,kDAKC;AAlDD,wEAAwC;AAGxC,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,eAAe;CAChB,CAAA;AACD,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;AAElD,SAAS,WAAW,CAAC,QAAe,EAAE,QAAe;IACnD,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgB,EAAE,QAAgB;IAC7D,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC5E,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,OAAO,GAAG,CAAA;IACZ,CAAC;IACD,OAAO,IAAI,GAAG,GAAG,CAAA;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,QAAa,EAAE,QAAa,EAAE,GAAW;IAC3D,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IACxC,CAAC;IACD,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,mBAAmB,CACjC,MAAS,EACT,GAAG,cAAyC;IAE5C,OAAO,IAAA,0BAAS,EAAC,EAAE,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,UAAU,CAAC,CAAA;AAC7D,CAAC","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,3 +1,3 @@
|
|
|
1
|
-
import { ILogger } from '../
|
|
1
|
+
import { ILogger } from '../environment';
|
|
2
2
|
import { IConfiguration } from './types';
|
|
3
3
|
export declare function parseConfiguration(logger: ILogger, source: string, definition: Partial<IConfiguration> | string[] | string | undefined): Partial<IConfiguration>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.parseConfiguration =
|
|
6
|
+
exports.parseConfiguration = parseConfiguration;
|
|
7
7
|
const string_argv_1 = __importDefault(require("string-argv"));
|
|
8
8
|
const argv_parser_1 = __importDefault(require("./argv_parser"));
|
|
9
9
|
const check_schema_1 = require("./check_schema");
|
|
@@ -36,5 +36,4 @@ function parseConfiguration(logger, source, definition) {
|
|
|
36
36
|
throw new Error(`${source} configuration value failed schema validation: ${error.errors.join(' ')}`);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
exports.parseConfiguration = parseConfiguration;
|
|
40
39
|
//# sourceMappingURL=parse_configuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_configuration.js","sourceRoot":"","sources":["../../src/configuration/parse_configuration.ts"],"names":[],"mappings":"
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import { ILogger } from '../
|
|
1
|
+
import { ILogger } from '../environment';
|
|
2
2
|
export declare function splitFormatDescriptor(logger: ILogger, option: string): string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitFormatDescriptor =
|
|
3
|
+
exports.splitFormatDescriptor = splitFormatDescriptor;
|
|
4
4
|
function splitFormatDescriptor(logger, option) {
|
|
5
5
|
const doWarning = (result) => {
|
|
6
6
|
let expected = `"${result[0]}"`;
|
|
@@ -72,5 +72,4 @@ Change to ${expected}`);
|
|
|
72
72
|
}
|
|
73
73
|
return result;
|
|
74
74
|
}
|
|
75
|
-
exports.splitFormatDescriptor = splitFormatDescriptor;
|
|
76
75
|
//# sourceMappingURL=split_format_descriptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split_format_descriptor.js","sourceRoot":"","sources":["../../src/configuration/split_format_descriptor.ts"],"names":[],"mappings":"
|
|
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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Descriptor(\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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateConfiguration =
|
|
3
|
+
exports.validateConfiguration = validateConfiguration;
|
|
4
4
|
function validateConfiguration(configuration, logger) {
|
|
5
5
|
if (configuration.publishQuiet) {
|
|
6
6
|
logger.warn('`publishQuiet` option is no longer needed, you can remove it from your configuration; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md');
|
|
@@ -15,5 +15,4 @@ function validateConfiguration(configuration, logger) {
|
|
|
15
15
|
throw new Error('a positive `retry` count must be specified when setting `retryTagFilter`');
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
exports.validateConfiguration = validateConfiguration;
|
|
19
18
|
//# sourceMappingURL=validate_configuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate_configuration.js","sourceRoot":"","sources":["../../src/configuration/validate_configuration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate_configuration.js","sourceRoot":"","sources":["../../src/configuration/validate_configuration.ts"],"names":[],"mappings":";;AAGA,sDAwBC;AAxBD,SAAgB,qBAAqB,CACnC,aAA6B,EAC7B,MAAe;IAEf,IAAI,aAAa,CAAC,YAAY,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CACT,kKAAkK,CACnK,CAAA;IACH,CAAC;IACD,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,cAAc,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,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.publishQuiet) {\n logger.warn(\n '`publishQuiet` option is no longer needed, you can remove it from your configuration; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md'\n )\n }\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.retryTagFilter && !configuration.retry) {\n throw new Error(\n 'a positive `retry` count must be specified when setting `retryTagFilter`'\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
import { ILogger } from './types';
|
|
3
|
+
export declare class ConsoleLogger implements ILogger {
|
|
4
|
+
private stream;
|
|
5
|
+
private debugEnabled;
|
|
6
|
+
private readonly console;
|
|
7
|
+
constructor(stream: Writable, debugEnabled: boolean);
|
|
8
|
+
debug(message?: any, ...optionalParams: any[]): void;
|
|
9
|
+
error(message?: any, ...optionalParams: any[]): void;
|
|
10
|
+
warn(message?: any, ...optionalParams: any[]): void;
|
|
11
|
+
}
|
|
@@ -11,16 +11,16 @@ class ConsoleLogger {
|
|
|
11
11
|
this.debugEnabled = debugEnabled;
|
|
12
12
|
this.console = new node_console_1.Console(this.stream);
|
|
13
13
|
}
|
|
14
|
-
debug(...
|
|
14
|
+
debug(message, ...optionalParams) {
|
|
15
15
|
if (this.debugEnabled) {
|
|
16
|
-
this.console.debug(...
|
|
16
|
+
this.console.debug(message, ...optionalParams);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
error(...
|
|
20
|
-
this.console.error(...
|
|
19
|
+
error(message, ...optionalParams) {
|
|
20
|
+
this.console.error(message, ...optionalParams);
|
|
21
21
|
}
|
|
22
|
-
warn(...
|
|
23
|
-
this.console.warn(...
|
|
22
|
+
warn(message, ...optionalParams) {
|
|
23
|
+
this.console.warn(message, ...optionalParams);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
exports.ConsoleLogger = ConsoleLogger;
|
|
@@ -0,0 +1 @@
|
|
|
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;CACF;AAvBD,sCAuBC","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"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./make_environment"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeEnvironment = makeEnvironment;
|
|
4
4
|
const console_logger_1 = require("./console_logger");
|
|
5
|
-
function
|
|
5
|
+
function makeEnvironment(provided) {
|
|
6
6
|
const fullEnvironment = Object.assign({}, {
|
|
7
7
|
cwd: process.cwd(),
|
|
8
8
|
stdout: process.stdout,
|
|
@@ -17,5 +17,4 @@ function mergeEnvironment(provided) {
|
|
|
17
17
|
logger: logger,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=environment.js.map
|
|
20
|
+
//# sourceMappingURL=make_environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
export interface ILogger {
|
|
3
|
+
debug: (message?: any, ...optionalParams: any[]) => void;
|
|
4
|
+
error: (message?: any, ...optionalParams: any[]) => void;
|
|
5
|
+
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Contextual data about the project environment
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface IRunEnvironment {
|
|
12
|
+
/**
|
|
13
|
+
* Working directory for the project
|
|
14
|
+
* @default process.cwd()
|
|
15
|
+
*/
|
|
16
|
+
cwd?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Writable stream where the test run's main formatter output is written
|
|
19
|
+
* @default process.stdout
|
|
20
|
+
*/
|
|
21
|
+
stdout?: Writable;
|
|
22
|
+
/**
|
|
23
|
+
* Writable stream where the test run's warning/error output is written
|
|
24
|
+
* @default process.stderr
|
|
25
|
+
*/
|
|
26
|
+
stderr?: Writable;
|
|
27
|
+
/**
|
|
28
|
+
* Environment variables
|
|
29
|
+
* @default process.env
|
|
30
|
+
*/
|
|
31
|
+
env?: Record<string, string | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Whether debug logging should be emitted to {@link IRunEnvironment.stderr}
|
|
34
|
+
* @default false
|
|
35
|
+
* @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/debugging.md}
|
|
36
|
+
*/
|
|
37
|
+
debug?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type UsableEnvironment = Required<IRunEnvironment> & {
|
|
40
|
+
logger: ILogger;
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/environment/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Writable } from 'node:stream'\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}\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"]}
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.isFileNameInCucumber = isFileNameInCucumber;
|
|
7
|
+
exports.filterStackTrace = filterStackTrace;
|
|
7
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
9
|
const value_checker_1 = require("./value_checker");
|
|
9
10
|
const projectRootPath = node_path_1.default.join(__dirname, '..');
|
|
@@ -11,7 +12,6 @@ const projectChildDirs = ['src', 'lib', 'node_modules'];
|
|
|
11
12
|
function isFileNameInCucumber(fileName) {
|
|
12
13
|
return projectChildDirs.some((dir) => fileName.startsWith(node_path_1.default.join(projectRootPath, dir)));
|
|
13
14
|
}
|
|
14
|
-
exports.isFileNameInCucumber = isFileNameInCucumber;
|
|
15
15
|
function filterStackTrace(frames) {
|
|
16
16
|
if (isErrorInCucumber(frames)) {
|
|
17
17
|
return frames;
|
|
@@ -22,7 +22,6 @@ function filterStackTrace(frames) {
|
|
|
22
22
|
}
|
|
23
23
|
return frames.slice(0, index);
|
|
24
24
|
}
|
|
25
|
-
exports.filterStackTrace = filterStackTrace;
|
|
26
25
|
function isErrorInCucumber(frames) {
|
|
27
26
|
const filteredFrames = frames.filter((x) => !isFrameInNode(x));
|
|
28
27
|
return filteredFrames.length > 0 && isFrameInCucumber(filteredFrames[0]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter_stack_trace.js","sourceRoot":"","sources":["../src/filter_stack_trace.ts"],"names":[],"mappings":"
|
|
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"]}
|