@cucumber/cucumber 7.3.2 → 8.0.0-rc.3
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 +88 -51
- package/api/index.d.ts +6 -0
- package/lib/api/convert_configuration.d.ts +4 -0
- package/lib/api/convert_configuration.js +64 -0
- package/lib/api/convert_configuration.js.map +1 -0
- package/lib/api/environment.d.ts +2 -0
- package/lib/api/environment.js +13 -0
- package/lib/api/environment.js.map +1 -0
- package/lib/api/formatters.d.ts +16 -0
- package/lib/api/formatters.js +72 -0
- package/lib/api/formatters.js.map +1 -0
- package/lib/api/gherkin.d.ts +21 -0
- package/lib/api/gherkin.js +65 -0
- package/lib/api/gherkin.js.map +1 -0
- package/lib/api/index.d.ts +11 -0
- package/lib/api/index.js +24 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/load_configuration.d.ts +9 -0
- package/lib/api/load_configuration.js +32 -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 +28 -0
- package/lib/api/load_support.js.map +1 -0
- package/lib/api/paths.d.ts +7 -0
- package/lib/api/paths.js +99 -0
- package/lib/api/paths.js.map +1 -0
- package/lib/api/run_cucumber.d.ts +11 -0
- package/lib/api/run_cucumber.js +108 -0
- package/lib/api/run_cucumber.js.map +1 -0
- package/lib/api/runtime.d.ts +20 -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 +21 -0
- package/lib/api/support.js.map +1 -0
- package/lib/api/types.d.ts +168 -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 +16 -9
- package/lib/cli/helpers.js +49 -32
- package/lib/cli/helpers.js.map +1 -1
- package/lib/cli/i18n.js +7 -7
- package/lib/cli/i18n.js.map +1 -1
- package/lib/cli/index.d.ts +6 -23
- package/lib/cli/index.js +38 -197
- package/lib/cli/index.js.map +1 -1
- package/lib/cli/install_validator.js +1 -1
- package/lib/cli/install_validator.js.map +1 -1
- package/lib/cli/publish_banner.js +6 -6
- package/lib/cli/publish_banner.js.map +1 -1
- package/lib/cli/run.js +15 -7
- package/lib/cli/run.js.map +1 -1
- package/lib/cli/validate_node_engine_version.d.ts +7 -0
- package/lib/cli/validate_node_engine_version.js +20 -0
- package/lib/cli/validate_node_engine_version.js.map +1 -0
- package/lib/configuration/argv_parser.d.ts +20 -0
- package/lib/{cli → configuration}/argv_parser.js +52 -53
- package/lib/configuration/argv_parser.js.map +1 -0
- package/lib/configuration/check_schema.d.ts +2 -0
- package/lib/configuration/check_schema.js +56 -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 +27 -0
- package/lib/configuration/default_configuration.js.map +1 -0
- package/lib/configuration/from_file.d.ts +2 -0
- package/lib/configuration/from_file.js +68 -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 +25 -0
- package/lib/configuration/index.js.map +1 -0
- package/lib/configuration/locate_file.d.ts +1 -0
- package/lib/configuration/locate_file.js +19 -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/{cli → configuration}/option_splitter.js +3 -2
- package/lib/configuration/option_splitter.js.map +1 -0
- package/lib/configuration/types.d.ts +25 -0
- package/lib/configuration/types.js +3 -0
- package/lib/configuration/types.js.map +1 -0
- package/lib/configuration/validate_configuration.d.ts +2 -0
- package/lib/configuration/validate_configuration.js +10 -0
- package/lib/configuration/validate_configuration.js.map +1 -0
- package/lib/formatter/builder.d.ts +7 -7
- package/lib/formatter/builder.js +48 -55
- package/lib/formatter/builder.js.map +1 -1
- package/lib/formatter/get_color_fns.js +15 -16
- package/lib/formatter/get_color_fns.js.map +1 -1
- package/lib/formatter/helpers/event_data_collector.d.ts +2 -1
- package/lib/formatter/helpers/event_data_collector.js +16 -15
- package/lib/formatter/helpers/event_data_collector.js.map +1 -1
- package/lib/formatter/helpers/formatters.d.ts +6 -0
- package/lib/formatter/helpers/formatters.js +41 -0
- package/lib/formatter/helpers/formatters.js.map +1 -0
- package/lib/formatter/helpers/gherkin_document_parser.js +29 -42
- package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -1
- package/lib/formatter/helpers/issue_helpers.d.ts +4 -4
- package/lib/formatter/helpers/issue_helpers.js +8 -9
- package/lib/formatter/helpers/issue_helpers.js.map +1 -1
- package/lib/formatter/helpers/keyword_type.js +2 -6
- package/lib/formatter/helpers/keyword_type.js.map +1 -1
- package/lib/formatter/helpers/location_helpers.js +1 -1
- package/lib/formatter/helpers/location_helpers.js.map +1 -1
- package/lib/formatter/helpers/pickle_parser.js +9 -18
- package/lib/formatter/helpers/pickle_parser.js.map +1 -1
- package/lib/formatter/helpers/step_argument_formatter.js +1 -1
- package/lib/formatter/helpers/step_argument_formatter.js.map +1 -1
- package/lib/formatter/helpers/summary_helpers.js +8 -7
- package/lib/formatter/helpers/summary_helpers.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_formatter.d.ts +2 -2
- package/lib/formatter/helpers/test_case_attempt_formatter.js +20 -19
- package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_parser.d.ts +1 -2
- package/lib/formatter/helpers/test_case_attempt_parser.js +18 -21
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
- package/lib/formatter/helpers/usage_helpers/index.d.ts +1 -2
- package/lib/formatter/helpers/usage_helpers/index.js +29 -43
- package/lib/formatter/helpers/usage_helpers/index.js.map +1 -1
- package/lib/formatter/html_formatter.d.ts +1 -0
- package/lib/formatter/html_formatter.js +5 -4
- package/lib/formatter/html_formatter.js.map +1 -1
- package/lib/formatter/http_stream.js +7 -7
- package/lib/formatter/http_stream.js.map +1 -1
- package/lib/formatter/index.d.ts +15 -2
- package/lib/formatter/index.js +2 -0
- package/lib/formatter/index.js.map +1 -1
- package/lib/formatter/json_formatter.d.ts +1 -0
- package/lib/formatter/json_formatter.js +25 -20
- package/lib/formatter/json_formatter.js.map +1 -1
- package/lib/formatter/message_formatter.d.ts +1 -0
- package/lib/formatter/message_formatter.js +1 -0
- package/lib/formatter/message_formatter.js.map +1 -1
- package/lib/formatter/progress_bar_formatter.d.ts +1 -0
- package/lib/formatter/progress_bar_formatter.js +18 -17
- package/lib/formatter/progress_bar_formatter.js.map +1 -1
- package/lib/formatter/progress_formatter.d.ts +1 -0
- package/lib/formatter/progress_formatter.js +3 -2
- package/lib/formatter/progress_formatter.js.map +1 -1
- package/lib/formatter/publish.d.ts +1 -0
- package/lib/formatter/publish.js +5 -0
- package/lib/formatter/publish.js.map +1 -0
- package/lib/formatter/rerun_formatter.d.ts +1 -0
- package/lib/formatter/rerun_formatter.js +15 -11
- package/lib/formatter/rerun_formatter.js.map +1 -1
- package/lib/formatter/snippets_formatter.d.ts +1 -0
- package/lib/formatter/snippets_formatter.js +3 -3
- package/lib/formatter/snippets_formatter.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/index.js +2 -2
- package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +3 -0
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts +1 -1
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -1
- package/lib/formatter/summary_formatter.d.ts +1 -0
- package/lib/formatter/summary_formatter.js +11 -11
- package/lib/formatter/summary_formatter.js.map +1 -1
- package/lib/formatter/usage_formatter.d.ts +1 -0
- package/lib/formatter/usage_formatter.js +9 -10
- package/lib/formatter/usage_formatter.js.map +1 -1
- package/lib/formatter/usage_json_formatter.d.ts +1 -0
- package/lib/formatter/usage_json_formatter.js +3 -3
- package/lib/formatter/usage_json_formatter.js.map +1 -1
- package/lib/importer.js +13 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +9 -1
- package/lib/index.js.map +1 -1
- package/lib/models/data_table.js +9 -7
- package/lib/models/data_table.js.map +1 -1
- 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.js +4 -5
- package/lib/models/step_definition.js.map +1 -1
- package/lib/pickle_filter.js +13 -13
- package/lib/pickle_filter.js.map +1 -1
- package/lib/runtime/assemble_test_cases.js +3 -3
- package/lib/runtime/assemble_test_cases.js.map +1 -1
- package/lib/runtime/attachment_manager/index.js +4 -4
- package/lib/runtime/attachment_manager/index.js.map +1 -1
- package/lib/runtime/helpers.d.ts +1 -0
- package/lib/runtime/helpers.js +42 -4
- package/lib/runtime/helpers.js.map +1 -1
- package/lib/runtime/index.d.ts +7 -7
- package/lib/runtime/index.js +12 -65
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/parallel/command_types.d.ts +3 -2
- package/lib/runtime/parallel/command_types.js.map +1 -1
- package/lib/runtime/parallel/coordinator.d.ts +32 -12
- package/lib/runtime/parallel/coordinator.js +82 -38
- package/lib/runtime/parallel/coordinator.js.map +1 -1
- package/lib/runtime/parallel/run_worker.js +1 -1
- package/lib/runtime/parallel/run_worker.js.map +1 -1
- package/lib/runtime/parallel/worker.d.ts +2 -4
- package/lib/runtime/parallel/worker.js +18 -33
- package/lib/runtime/parallel/worker.js.map +1 -1
- 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.js +5 -7
- package/lib/runtime/step_runner.js.map +1 -1
- package/lib/runtime/stopwatch.js +4 -4
- package/lib/runtime/stopwatch.js.map +1 -1
- package/lib/runtime/test_case_runner.d.ts +3 -3
- package/lib/runtime/test_case_runner.js +19 -28
- package/lib/runtime/test_case_runner.js.map +1 -1
- package/lib/stack_trace_filter.js +6 -7
- package/lib/stack_trace_filter.js.map +1 -1
- package/lib/step_arguments.js +2 -2
- package/lib/step_arguments.js.map +1 -1
- package/lib/support_code_library_builder/{build_helpers.d.ts → build_parameter_type.d.ts} +0 -2
- 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 +30 -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 +4 -2
- package/lib/support_code_library_builder/index.js +43 -34
- package/lib/support_code_library_builder/index.js.map +1 -1
- 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/types.d.ts +10 -0
- package/lib/support_code_library_builder/types.js.map +1 -1
- package/lib/support_code_library_builder/validate_arguments.js +14 -19
- package/lib/support_code_library_builder/validate_arguments.js.map +1 -1
- package/lib/time.d.ts +1 -0
- package/lib/time.js +17 -2
- package/lib/time.js.map +1 -1
- package/lib/user_code_runner.js +10 -17
- package/lib/user_code_runner.js.map +1 -1
- package/lib/value_checker.d.ts +2 -2
- package/lib/value_checker.js.map +1 -1
- package/lib/version.d.ts +1 -0
- package/lib/version.js +6 -0
- package/lib/version.js.map +1 -0
- package/lib/wrapper.mjs +42 -0
- package/package.json +98 -70
- package/lib/cli/argv_parser.d.ts +0 -51
- package/lib/cli/argv_parser.js.map +0 -1
- package/lib/cli/configuration_builder.d.ts +0 -46
- package/lib/cli/configuration_builder.js +0 -161
- package/lib/cli/configuration_builder.js.map +0 -1
- package/lib/cli/option_splitter.d.ts +0 -4
- package/lib/cli/option_splitter.js.map +0 -1
- package/lib/cli/profile_loader.d.ts +0 -6
- package/lib/cli/profile_loader.js +0 -42
- package/lib/cli/profile_loader.js.map +0 -1
- package/lib/support_code_library_builder/build_helpers.js +0 -41
- package/lib/support_code_library_builder/build_helpers.js.map +0 -1
- package/lib/support_code_library_builder/finalize_helpers.d.ts +0 -10
- package/lib/support_code_library_builder/finalize_helpers.js +0 -26
- package/lib/support_code_library_builder/finalize_helpers.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isTruthyString(s: string | undefined): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTruthyString = void 0;
|
|
4
|
+
function isTruthyString(s) {
|
|
5
|
+
if (s === undefined) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
return s.match(/^(false|no|0)$/i) === null;
|
|
9
|
+
}
|
|
10
|
+
exports.isTruthyString = isTruthyString;
|
|
11
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/configuration/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAC,CAAqB;IAClD,IAAI,CAAC,KAAK,SAAS,EAAE;QACnB,OAAO,KAAK,CAAA;KACb;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;AAC5C,CAAC;AALD,wCAKC","sourcesContent":["export function isTruthyString(s: string | undefined): boolean {\n if (s === undefined) {\n return false\n }\n return s.match(/^(false|no|0)$/i) === null\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ArgvParser = void 0;
|
|
17
|
+
var argv_parser_1 = require("./argv_parser");
|
|
18
|
+
Object.defineProperty(exports, "ArgvParser", { enumerable: true, get: function () { return __importDefault(argv_parser_1).default; } });
|
|
19
|
+
__exportStar(require("./default_configuration"), exports);
|
|
20
|
+
__exportStar(require("./from_file"), exports);
|
|
21
|
+
__exportStar(require("./helpers"), exports);
|
|
22
|
+
__exportStar(require("./merge_configurations"), exports);
|
|
23
|
+
__exportStar(require("./option_splitter"), exports);
|
|
24
|
+
__exportStar(require("./types"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/configuration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAAqD;AAA5C,0HAAA,OAAO,OAAc;AAC9B,0DAAuC;AACvC,8CAA2B;AAC3B,4CAAyB;AACzB,yDAAsC;AACtC,oDAAiC;AACjC,0CAAuB","sourcesContent":["export { default as ArgvParser } from './argv_parser'\nexport * from './default_configuration'\nexport * from './from_file'\nexport * from './helpers'\nexport * from './merge_configurations'\nexport * from './option_splitter'\nexport * from './types'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function locateFile(cwd: string): string | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.locateFile = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("mz/fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const DEFAULT_FILENAMES = [
|
|
10
|
+
'cucumber.js',
|
|
11
|
+
'cucumber.cjs',
|
|
12
|
+
'cucumber.mjs',
|
|
13
|
+
'cucumber.json',
|
|
14
|
+
];
|
|
15
|
+
function locateFile(cwd) {
|
|
16
|
+
return DEFAULT_FILENAMES.find((filename) => fs_1.default.existsSync(path_1.default.join(cwd, filename)));
|
|
17
|
+
}
|
|
18
|
+
exports.locateFile = locateFile;
|
|
19
|
+
//# sourceMappingURL=locate_file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locate_file.js","sourceRoot":"","sources":["../../src/configuration/locate_file.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAsB;AACtB,gDAAuB;AAEvB,MAAM,iBAAiB,GAAG;IACxB,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;CAChB,CAAA;AAED,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACzC,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CACxC,CAAA;AACH,CAAC;AAJD,gCAIC","sourcesContent":["import fs from 'mz/fs'\nimport path from 'path'\n\nconst DEFAULT_FILENAMES = [\n 'cucumber.js',\n 'cucumber.cjs',\n 'cucumber.mjs',\n 'cucumber.json',\n]\n\nexport function locateFile(cwd: string): string | undefined {\n return DEFAULT_FILENAMES.find((filename) =>\n fs.existsSync(path.join(cwd, filename))\n )\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mergeConfigurations = void 0;
|
|
7
|
+
const lodash_mergewith_1 = __importDefault(require("lodash.mergewith"));
|
|
8
|
+
const ADDITIVE_ARRAYS = [
|
|
9
|
+
'format',
|
|
10
|
+
'import',
|
|
11
|
+
'name',
|
|
12
|
+
'paths',
|
|
13
|
+
'require',
|
|
14
|
+
'requireModule',
|
|
15
|
+
];
|
|
16
|
+
const TAG_EXPRESSIONS = ['tags', 'retryTagFilter'];
|
|
17
|
+
function mergeArrays(objValue, srcValue) {
|
|
18
|
+
if (objValue && srcValue) {
|
|
19
|
+
return [].concat(objValue, srcValue);
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function mergeTagExpressions(objValue, srcValue) {
|
|
24
|
+
if (objValue && srcValue) {
|
|
25
|
+
return `${wrapTagExpression(objValue)} and ${wrapTagExpression(srcValue)}`;
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
function wrapTagExpression(raw) {
|
|
30
|
+
if (raw.startsWith('(') && raw.endsWith(')')) {
|
|
31
|
+
return raw;
|
|
32
|
+
}
|
|
33
|
+
return `(${raw})`;
|
|
34
|
+
}
|
|
35
|
+
function customizer(objValue, srcValue, key) {
|
|
36
|
+
if (ADDITIVE_ARRAYS.includes(key)) {
|
|
37
|
+
return mergeArrays(objValue, srcValue);
|
|
38
|
+
}
|
|
39
|
+
if (TAG_EXPRESSIONS.includes(key)) {
|
|
40
|
+
return mergeTagExpressions(objValue, srcValue);
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
function mergeConfigurations(source, ...configurations) {
|
|
45
|
+
return (0, lodash_mergewith_1.default)({}, source, ...configurations, customizer);
|
|
46
|
+
}
|
|
47
|
+
exports.mergeConfigurations = mergeConfigurations;
|
|
48
|
+
//# sourceMappingURL=merge_configurations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge_configurations.js","sourceRoot":"","sources":["../../src/configuration/merge_configurations.ts"],"names":[],"mappings":";;;;;;AACA,wEAAwC;AAExC,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,eAAe;CAChB,CAAA;AACD,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;AAElD,SAAS,WAAW,CAAC,QAAe,EAAE,QAAe;IACnD,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;KACrC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgB,EAAE,QAAgB;IAC7D,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAA;KAC3E;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC5C,OAAO,GAAG,CAAA;KACX;IACD,OAAO,IAAI,GAAG,GAAG,CAAA;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,QAAa,EAAE,QAAa,EAAE,GAAW;IAC3D,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACjC,OAAO,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;KACvC;IACD,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACjC,OAAO,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;KAC/C;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,mBAAmB,CACjC,MAAS,EACT,GAAG,cAAyC;IAE5C,OAAO,IAAA,0BAAS,EAAC,EAAE,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,UAAU,CAAC,CAAA;AAC7D,CAAC;AALD,kDAKC","sourcesContent":["import { IConfiguration } from './types'\nimport mergeWith from 'lodash.mergewith'\n\nconst ADDITIVE_ARRAYS = [\n 'format',\n 'import',\n 'name',\n 'paths',\n 'require',\n 'requireModule',\n]\nconst TAG_EXPRESSIONS = ['tags', 'retryTagFilter']\n\nfunction mergeArrays(objValue: any[], srcValue: any[]) {\n if (objValue && srcValue) {\n return [].concat(objValue, srcValue)\n }\n return undefined\n}\n\nfunction mergeTagExpressions(objValue: string, srcValue: string) {\n if (objValue && srcValue) {\n return `${wrapTagExpression(objValue)} and ${wrapTagExpression(srcValue)}`\n }\n return undefined\n}\n\nfunction wrapTagExpression(raw: string) {\n if (raw.startsWith('(') && raw.endsWith(')')) {\n return raw\n }\n return `(${raw})`\n}\n\nfunction customizer(objValue: any, srcValue: any, key: string): any {\n if (ADDITIVE_ARRAYS.includes(key)) {\n return mergeArrays(objValue, srcValue)\n }\n if (TAG_EXPRESSIONS.includes(key)) {\n return mergeTagExpressions(objValue, srcValue)\n }\n return undefined\n}\n\nexport function mergeConfigurations<T = Partial<IConfiguration>>(\n source: T,\n ...configurations: Partial<IConfiguration>[]\n): T {\n return mergeWith({}, source, ...configurations, customizer)\n}\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.OptionSplitter = void 0;
|
|
4
|
+
exports.OptionSplitter = {
|
|
4
5
|
split(option) {
|
|
6
|
+
option = option.replace(/"/g, '');
|
|
5
7
|
const parts = option.split(/([^A-Z]):(?!\\)/);
|
|
6
8
|
const result = parts.reduce((memo, part, i) => {
|
|
7
9
|
if (partNeedsRecombined(i)) {
|
|
@@ -18,5 +20,4 @@ const OptionSplitter = {
|
|
|
18
20
|
function partNeedsRecombined(i) {
|
|
19
21
|
return i % 2 === 0;
|
|
20
22
|
}
|
|
21
|
-
exports.default = OptionSplitter;
|
|
22
23
|
//# sourceMappingURL=option_splitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option_splitter.js","sourceRoot":"","sources":["../../src/configuration/option_splitter.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,MAAc;QAClB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QAEjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;QAE7C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAc,EAAE,IAAY,EAAE,CAAS,EAAE,EAAE;YACtE,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;gBAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;aAC1C;YAED,OAAO,IAAI,CAAA;QACb,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SAChB;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAS,mBAAmB,CAAC,CAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AACpB,CAAC","sourcesContent":["export const OptionSplitter = {\n split(option: string): string[] {\n option = option.replace(/\"/g, '')\n\n const parts = option.split(/([^A-Z]):(?!\\\\)/)\n\n const result = parts.reduce((memo: string[], part: string, i: number) => {\n if (partNeedsRecombined(i)) {\n memo.push(parts.slice(i, i + 2).join(''))\n }\n\n return memo\n }, [])\n\n if (result.length === 1) {\n result.push('')\n }\n\n return result\n },\n}\n\nfunction partNeedsRecombined(i: number): boolean {\n return i % 2 === 0\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FormatOptions } from '../formatter';
|
|
2
|
+
import { PickleOrder } from '../models/pickle_order';
|
|
3
|
+
export interface IConfiguration {
|
|
4
|
+
backtrace: boolean;
|
|
5
|
+
dryRun: boolean;
|
|
6
|
+
forceExit: boolean;
|
|
7
|
+
failFast: boolean;
|
|
8
|
+
format: string[];
|
|
9
|
+
formatOptions: FormatOptions;
|
|
10
|
+
import: string[];
|
|
11
|
+
language: string;
|
|
12
|
+
name: string[];
|
|
13
|
+
order: PickleOrder;
|
|
14
|
+
paths: string[];
|
|
15
|
+
parallel: number;
|
|
16
|
+
publish: boolean;
|
|
17
|
+
publishQuiet: boolean;
|
|
18
|
+
require: string[];
|
|
19
|
+
requireModule: string[];
|
|
20
|
+
retry: number;
|
|
21
|
+
retryTagFilter: string;
|
|
22
|
+
strict: boolean;
|
|
23
|
+
tags: string;
|
|
24
|
+
worldParameters: any;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/configuration/types.ts"],"names":[],"mappings":"","sourcesContent":["import { FormatOptions } from '../formatter'\nimport { PickleOrder } from '../models/pickle_order'\n\nexport interface IConfiguration {\n backtrace: boolean\n dryRun: boolean\n forceExit: boolean\n failFast: boolean\n format: string[]\n formatOptions: FormatOptions\n import: string[]\n language: string\n name: string[]\n order: PickleOrder\n paths: string[]\n parallel: number\n publish: boolean\n publishQuiet: boolean\n require: string[]\n requireModule: string[]\n retry: number\n retryTagFilter: string\n strict: boolean\n tags: string\n worldParameters: any\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateConfiguration = void 0;
|
|
4
|
+
function validateConfiguration(configuration) {
|
|
5
|
+
if (configuration.retryTagFilter && !configuration.retry) {
|
|
6
|
+
throw new Error('a positive `retry` count must be specified when setting `retryTagFilter`');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.validateConfiguration = validateConfiguration;
|
|
10
|
+
//# sourceMappingURL=validate_configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate_configuration.js","sourceRoot":"","sources":["../../src/configuration/validate_configuration.ts"],"names":[],"mappings":";;;AAEA,SAAgB,qBAAqB,CAAC,aAA6B;IACjE,IAAI,aAAa,CAAC,cAAc,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;QACxD,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAA;KACF;AACH,CAAC;AAND,sDAMC","sourcesContent":["import { IConfiguration } from './types'\n\nexport function validateConfiguration(configuration: IConfiguration): void {\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"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import StepDefinitionSnippetBuilder from './step_definition_snippet_builder';
|
|
3
3
|
import { ISupportCodeLibrary } from '../support_code_library_builder/types';
|
|
4
|
-
import Formatter, { IFormatterCleanupFn, IFormatterLogFn } from '.';
|
|
4
|
+
import Formatter, { FormatOptions, IFormatterCleanupFn, IFormatterLogFn } from '.';
|
|
5
5
|
import { EventEmitter } from 'events';
|
|
6
6
|
import EventDataCollector from './helpers/event_data_collector';
|
|
7
7
|
import { Writable as WritableStream } from 'stream';
|
|
8
|
-
import { IParsedArgvFormatOptions } from '../cli/argv_parser';
|
|
9
8
|
import { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax';
|
|
10
9
|
interface IGetStepDefinitionSnippetBuilderOptions {
|
|
11
10
|
cwd: string;
|
|
@@ -18,15 +17,16 @@ export interface IBuildOptions {
|
|
|
18
17
|
eventBroadcaster: EventEmitter;
|
|
19
18
|
eventDataCollector: EventDataCollector;
|
|
20
19
|
log: IFormatterLogFn;
|
|
21
|
-
parsedArgvOptions:
|
|
20
|
+
parsedArgvOptions: FormatOptions;
|
|
22
21
|
stream: WritableStream;
|
|
23
22
|
cleanup: IFormatterCleanupFn;
|
|
24
23
|
supportCodeLibrary: ISupportCodeLibrary;
|
|
25
24
|
}
|
|
26
25
|
declare const FormatterBuilder: {
|
|
27
|
-
build(type: string, options: IBuildOptions): Formatter
|
|
28
|
-
getConstructorByType(type: string, cwd: string): typeof Formatter
|
|
29
|
-
getStepDefinitionSnippetBuilder({ cwd, snippetInterface, snippetSyntax, supportCodeLibrary, }: IGetStepDefinitionSnippetBuilderOptions): StepDefinitionSnippetBuilder
|
|
30
|
-
|
|
26
|
+
build(type: string, options: IBuildOptions): Promise<Formatter>;
|
|
27
|
+
getConstructorByType(type: string, cwd: string): Promise<typeof Formatter>;
|
|
28
|
+
getStepDefinitionSnippetBuilder({ cwd, snippetInterface, snippetSyntax, supportCodeLibrary, }: IGetStepDefinitionSnippetBuilderOptions): Promise<StepDefinitionSnippetBuilder>;
|
|
29
|
+
loadCustomClass(type: 'formatter' | 'syntax', descriptor: string, cwd: string): Promise<any>;
|
|
30
|
+
resolveConstructor(ImportedCode: any): any;
|
|
31
31
|
};
|
|
32
32
|
export default FormatterBuilder;
|
package/lib/formatter/builder.js
CHANGED
|
@@ -5,84 +5,77 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const get_color_fns_1 = __importDefault(require("./get_color_fns"));
|
|
7
7
|
const javascript_snippet_syntax_1 = __importDefault(require("./step_definition_snippet_builder/javascript_snippet_syntax"));
|
|
8
|
-
const json_formatter_1 = __importDefault(require("./json_formatter"));
|
|
9
|
-
const message_formatter_1 = __importDefault(require("./message_formatter"));
|
|
10
8
|
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const progress_bar_formatter_1 = __importDefault(require("./progress_bar_formatter"));
|
|
12
|
-
const progress_formatter_1 = __importDefault(require("./progress_formatter"));
|
|
13
|
-
const rerun_formatter_1 = __importDefault(require("./rerun_formatter"));
|
|
14
|
-
const snippets_formatter_1 = __importDefault(require("./snippets_formatter"));
|
|
15
9
|
const step_definition_snippet_builder_1 = __importDefault(require("./step_definition_snippet_builder"));
|
|
16
|
-
const summary_formatter_1 = __importDefault(require("./summary_formatter"));
|
|
17
|
-
const usage_formatter_1 = __importDefault(require("./usage_formatter"));
|
|
18
|
-
const usage_json_formatter_1 = __importDefault(require("./usage_json_formatter"));
|
|
19
10
|
const value_checker_1 = require("../value_checker");
|
|
20
11
|
const snippet_syntax_1 = require("./step_definition_snippet_builder/snippet_syntax");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
12
|
+
const url_1 = require("url");
|
|
13
|
+
const formatters_1 = __importDefault(require("./helpers/formatters"));
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
15
|
+
const { importer } = require('../importer');
|
|
23
16
|
const FormatterBuilder = {
|
|
24
|
-
build(type, options) {
|
|
25
|
-
const FormatterConstructor = FormatterBuilder.getConstructorByType(type, options.cwd);
|
|
26
|
-
const colorFns = get_color_fns_1.default(options.parsedArgvOptions.colorsEnabled);
|
|
27
|
-
const snippetBuilder = FormatterBuilder.getStepDefinitionSnippetBuilder({
|
|
17
|
+
async build(type, options) {
|
|
18
|
+
const FormatterConstructor = await FormatterBuilder.getConstructorByType(type, options.cwd);
|
|
19
|
+
const colorFns = (0, get_color_fns_1.default)(options.parsedArgvOptions.colorsEnabled);
|
|
20
|
+
const snippetBuilder = await FormatterBuilder.getStepDefinitionSnippetBuilder({
|
|
28
21
|
cwd: options.cwd,
|
|
29
22
|
snippetInterface: options.parsedArgvOptions.snippetInterface,
|
|
30
23
|
snippetSyntax: options.parsedArgvOptions.snippetSyntax,
|
|
31
24
|
supportCodeLibrary: options.supportCodeLibrary,
|
|
32
25
|
});
|
|
33
|
-
return new FormatterConstructor(
|
|
34
|
-
|
|
26
|
+
return new FormatterConstructor({
|
|
27
|
+
colorFns,
|
|
28
|
+
snippetBuilder,
|
|
29
|
+
...options,
|
|
30
|
+
});
|
|
35
31
|
},
|
|
36
|
-
getConstructorByType(type, cwd) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return message_formatter_1.default;
|
|
42
|
-
case 'html':
|
|
43
|
-
return html_formatter_1.default;
|
|
44
|
-
case 'progress':
|
|
45
|
-
return progress_formatter_1.default;
|
|
46
|
-
case 'progress-bar':
|
|
47
|
-
return progress_bar_formatter_1.default;
|
|
48
|
-
case 'rerun':
|
|
49
|
-
return rerun_formatter_1.default;
|
|
50
|
-
case 'snippets':
|
|
51
|
-
return snippets_formatter_1.default;
|
|
52
|
-
case 'summary':
|
|
53
|
-
return summary_formatter_1.default;
|
|
54
|
-
case 'usage':
|
|
55
|
-
return usage_formatter_1.default;
|
|
56
|
-
case 'usage-json':
|
|
57
|
-
return usage_json_formatter_1.default;
|
|
58
|
-
default:
|
|
59
|
-
return FormatterBuilder.loadCustomFormatter(type, cwd);
|
|
60
|
-
}
|
|
32
|
+
async getConstructorByType(type, cwd) {
|
|
33
|
+
const formatters = formatters_1.default.getFormatters();
|
|
34
|
+
return formatters[type]
|
|
35
|
+
? formatters[type]
|
|
36
|
+
: await FormatterBuilder.loadCustomClass('formatter', type, cwd);
|
|
61
37
|
},
|
|
62
|
-
getStepDefinitionSnippetBuilder({ cwd, snippetInterface, snippetSyntax, supportCodeLibrary, }) {
|
|
63
|
-
if (value_checker_1.doesNotHaveValue(snippetInterface)) {
|
|
38
|
+
async getStepDefinitionSnippetBuilder({ cwd, snippetInterface, snippetSyntax, supportCodeLibrary, }) {
|
|
39
|
+
if ((0, value_checker_1.doesNotHaveValue)(snippetInterface)) {
|
|
64
40
|
snippetInterface = snippet_syntax_1.SnippetInterface.Synchronous;
|
|
65
41
|
}
|
|
66
42
|
let Syntax = javascript_snippet_syntax_1.default;
|
|
67
|
-
if (value_checker_1.doesHaveValue(snippetSyntax)) {
|
|
68
|
-
|
|
69
|
-
Syntax = require(fullSyntaxPath); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
43
|
+
if ((0, value_checker_1.doesHaveValue)(snippetSyntax)) {
|
|
44
|
+
Syntax = await FormatterBuilder.loadCustomClass('syntax', snippetSyntax, cwd);
|
|
70
45
|
}
|
|
71
46
|
return new step_definition_snippet_builder_1.default({
|
|
72
47
|
snippetSyntax: new Syntax(snippetInterface),
|
|
73
48
|
parameterTypeRegistry: supportCodeLibrary.parameterTypeRegistry,
|
|
74
49
|
});
|
|
75
50
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
51
|
+
async loadCustomClass(type, descriptor, cwd) {
|
|
52
|
+
let CustomClass = descriptor.startsWith(`.`)
|
|
53
|
+
? await importer((0, url_1.pathToFileURL)(path_1.default.resolve(cwd, descriptor)))
|
|
54
|
+
: await importer(descriptor);
|
|
55
|
+
CustomClass = FormatterBuilder.resolveConstructor(CustomClass);
|
|
56
|
+
if ((0, value_checker_1.doesHaveValue)(CustomClass)) {
|
|
57
|
+
return CustomClass;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
throw new Error(`Custom ${type} (${descriptor}) does not export a function/class`);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
resolveConstructor(ImportedCode) {
|
|
64
|
+
if ((0, value_checker_1.doesNotHaveValue)(ImportedCode)) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
if (typeof ImportedCode === 'function') {
|
|
68
|
+
return ImportedCode;
|
|
69
|
+
}
|
|
70
|
+
else if (typeof ImportedCode === 'object' &&
|
|
71
|
+
typeof ImportedCode.default === 'function') {
|
|
72
|
+
return ImportedCode.default;
|
|
80
73
|
}
|
|
81
|
-
else if (
|
|
82
|
-
typeof
|
|
83
|
-
return
|
|
74
|
+
else if (typeof ImportedCode.default === 'object' &&
|
|
75
|
+
typeof ImportedCode.default.default === 'function') {
|
|
76
|
+
return ImportedCode.default.default;
|
|
84
77
|
}
|
|
85
|
-
|
|
78
|
+
return null;
|
|
86
79
|
},
|
|
87
80
|
};
|
|
88
81
|
exports.default = FormatterBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/formatter/builder.ts"],"names":[],"mappings":";;;;;AAAA,oEAAyC;AACzC,4HAAiG;AACjG,
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/formatter/builder.ts"],"names":[],"mappings":"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","sourcesContent":["import getColorFns from './get_color_fns'\nimport JavascriptSnippetSyntax from './step_definition_snippet_builder/javascript_snippet_syntax'\nimport path from 'path'\nimport StepDefinitionSnippetBuilder from './step_definition_snippet_builder'\nimport { ISupportCodeLibrary } from '../support_code_library_builder/types'\nimport Formatter, {\n FormatOptions,\n IFormatterCleanupFn,\n IFormatterLogFn,\n} from '.'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport { EventEmitter } from 'events'\nimport EventDataCollector from './helpers/event_data_collector'\nimport { Writable as WritableStream } from 'stream'\nimport { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'\nimport { pathToFileURL } from 'url'\nimport Formatters from './helpers/formatters'\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { importer } = require('../importer')\n\ninterface IGetStepDefinitionSnippetBuilderOptions {\n cwd: string\n snippetInterface?: SnippetInterface\n snippetSyntax?: string\n supportCodeLibrary: ISupportCodeLibrary\n}\n\nexport interface IBuildOptions {\n cwd: string\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n log: IFormatterLogFn\n parsedArgvOptions: FormatOptions\n stream: WritableStream\n cleanup: IFormatterCleanupFn\n supportCodeLibrary: ISupportCodeLibrary\n}\n\nconst FormatterBuilder = {\n async build(type: string, options: IBuildOptions): Promise<Formatter> {\n const FormatterConstructor = await FormatterBuilder.getConstructorByType(\n type,\n options.cwd\n )\n const colorFns = getColorFns(options.parsedArgvOptions.colorsEnabled)\n const snippetBuilder =\n await FormatterBuilder.getStepDefinitionSnippetBuilder({\n cwd: options.cwd,\n snippetInterface: options.parsedArgvOptions.snippetInterface,\n snippetSyntax: options.parsedArgvOptions.snippetSyntax,\n supportCodeLibrary: options.supportCodeLibrary,\n })\n return new FormatterConstructor({\n colorFns,\n snippetBuilder,\n ...options,\n })\n },\n\n async getConstructorByType(\n type: string,\n cwd: string\n ): Promise<typeof Formatter> {\n const formatters: Record<string, typeof Formatter> =\n Formatters.getFormatters()\n\n return formatters[type]\n ? formatters[type]\n : await FormatterBuilder.loadCustomClass('formatter', type, cwd)\n },\n\n async getStepDefinitionSnippetBuilder({\n cwd,\n snippetInterface,\n snippetSyntax,\n supportCodeLibrary,\n }: IGetStepDefinitionSnippetBuilderOptions) {\n if (doesNotHaveValue(snippetInterface)) {\n snippetInterface = SnippetInterface.Synchronous\n }\n let Syntax = JavascriptSnippetSyntax\n if (doesHaveValue(snippetSyntax)) {\n Syntax = await FormatterBuilder.loadCustomClass(\n 'syntax',\n snippetSyntax,\n cwd\n )\n }\n return new StepDefinitionSnippetBuilder({\n snippetSyntax: new Syntax(snippetInterface),\n parameterTypeRegistry: supportCodeLibrary.parameterTypeRegistry,\n })\n },\n\n async loadCustomClass(\n type: 'formatter' | 'syntax',\n descriptor: string,\n cwd: string\n ) {\n let CustomClass = descriptor.startsWith(`.`)\n ? await importer(pathToFileURL(path.resolve(cwd, descriptor)))\n : await importer(descriptor)\n CustomClass = FormatterBuilder.resolveConstructor(CustomClass)\n if (doesHaveValue(CustomClass)) {\n return CustomClass\n } else {\n throw new Error(\n `Custom ${type} (${descriptor}) does not export a function/class`\n )\n }\n },\n\n resolveConstructor(ImportedCode: any) {\n if (doesNotHaveValue(ImportedCode)) {\n return null\n }\n if (typeof ImportedCode === 'function') {\n return ImportedCode\n } else if (\n typeof ImportedCode === 'object' &&\n typeof ImportedCode.default === 'function'\n ) {\n return ImportedCode.default\n } else if (\n typeof ImportedCode.default === 'object' &&\n typeof ImportedCode.default.default === 'function'\n ) {\n return ImportedCode.default.default\n }\n return null\n },\n}\n\nexport default FormatterBuilder\n"]}
|
|
@@ -3,33 +3,32 @@ 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
|
-
const
|
|
7
|
-
safe_1.default.enable();
|
|
6
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
7
|
function getColorFns(enabled) {
|
|
9
8
|
if (enabled) {
|
|
10
9
|
return {
|
|
11
10
|
forStatus(status) {
|
|
12
11
|
return {
|
|
13
|
-
AMBIGUOUS:
|
|
14
|
-
FAILED:
|
|
15
|
-
PASSED:
|
|
16
|
-
PENDING:
|
|
17
|
-
SKIPPED:
|
|
18
|
-
UNDEFINED:
|
|
19
|
-
UNKNOWN:
|
|
12
|
+
AMBIGUOUS: chalk_1.default.red.bind(chalk_1.default),
|
|
13
|
+
FAILED: chalk_1.default.red.bind(chalk_1.default),
|
|
14
|
+
PASSED: chalk_1.default.green.bind(chalk_1.default),
|
|
15
|
+
PENDING: chalk_1.default.yellow.bind(chalk_1.default),
|
|
16
|
+
SKIPPED: chalk_1.default.cyan.bind(chalk_1.default),
|
|
17
|
+
UNDEFINED: chalk_1.default.yellow.bind(chalk_1.default),
|
|
18
|
+
UNKNOWN: chalk_1.default.yellow.bind(chalk_1.default),
|
|
20
19
|
}[status];
|
|
21
20
|
},
|
|
22
|
-
location:
|
|
23
|
-
tag:
|
|
24
|
-
diffAdded:
|
|
25
|
-
diffRemoved:
|
|
26
|
-
errorMessage:
|
|
27
|
-
errorStack:
|
|
21
|
+
location: chalk_1.default.gray.bind(chalk_1.default),
|
|
22
|
+
tag: chalk_1.default.cyan.bind(chalk_1.default),
|
|
23
|
+
diffAdded: chalk_1.default.green.bind(chalk_1.default),
|
|
24
|
+
diffRemoved: chalk_1.default.red.bind(chalk_1.default),
|
|
25
|
+
errorMessage: chalk_1.default.red.bind(chalk_1.default),
|
|
26
|
+
errorStack: chalk_1.default.grey.bind(chalk_1.default),
|
|
28
27
|
};
|
|
29
28
|
}
|
|
30
29
|
else {
|
|
31
30
|
return {
|
|
32
|
-
forStatus(
|
|
31
|
+
forStatus(_status) {
|
|
33
32
|
return (x) => x;
|
|
34
33
|
},
|
|
35
34
|
location: (x) => x,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_color_fns.js","sourceRoot":"","sources":["../../src/formatter/get_color_fns.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"get_color_fns.js","sourceRoot":"","sources":["../../src/formatter/get_color_fns.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAezB,SAAwB,WAAW,CAAC,OAAgB;IAClD,IAAI,OAAO,EAAE;QACX,OAAO;YACL,SAAS,CAAC,MAA4B;gBACpC,OAAO;oBACL,SAAS,EAAE,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;oBAChC,MAAM,EAAE,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;oBAC7B,MAAM,EAAE,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAK,CAAC;oBAC/B,OAAO,EAAE,eAAK,CAAC,MAAM,CAAC,IAAI,CAAC,eAAK,CAAC;oBACjC,OAAO,EAAE,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAK,CAAC;oBAC/B,SAAS,EAAE,eAAK,CAAC,MAAM,CAAC,IAAI,CAAC,eAAK,CAAC;oBACnC,OAAO,EAAE,eAAK,CAAC,MAAM,CAAC,IAAI,CAAC,eAAK,CAAC;iBAClC,CAAC,MAAM,CAAC,CAAA;YACX,CAAC;YACD,QAAQ,EAAE,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAK,CAAC;YAChC,GAAG,EAAE,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAK,CAAC;YAC3B,SAAS,EAAE,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAK,CAAC;YAClC,WAAW,EAAE,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;YAClC,YAAY,EAAE,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;YACnC,UAAU,EAAE,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAK,CAAC;SACnC,CAAA;KACF;SAAM;QACL,OAAO;YACL,SAAS,CAAC,OAA6B;gBACrC,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;YACjB,CAAC;YACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAClB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACb,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnB,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACrB,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACtB,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SACrB,CAAA;KACF;AACH,CAAC;AAlCD,8BAkCC","sourcesContent":["import chalk from 'chalk'\nimport { TestStepResultStatus } from '@cucumber/messages'\n\nexport type IColorFn = (text: string) => string\n\nexport interface IColorFns {\n forStatus: (status: TestStepResultStatus) => IColorFn\n location: IColorFn\n tag: IColorFn\n diffAdded: IColorFn\n diffRemoved: IColorFn\n errorMessage: IColorFn\n errorStack: IColorFn\n}\n\nexport default function getColorFns(enabled: boolean): IColorFns {\n if (enabled) {\n return {\n forStatus(status: TestStepResultStatus) {\n return {\n AMBIGUOUS: chalk.red.bind(chalk),\n FAILED: chalk.red.bind(chalk),\n PASSED: chalk.green.bind(chalk),\n PENDING: chalk.yellow.bind(chalk),\n SKIPPED: chalk.cyan.bind(chalk),\n UNDEFINED: chalk.yellow.bind(chalk),\n UNKNOWN: chalk.yellow.bind(chalk),\n }[status]\n },\n location: chalk.gray.bind(chalk),\n tag: chalk.cyan.bind(chalk),\n diffAdded: chalk.green.bind(chalk),\n diffRemoved: chalk.red.bind(chalk),\n errorMessage: chalk.red.bind(chalk),\n errorStack: chalk.grey.bind(chalk),\n }\n } else {\n return {\n forStatus(_status: TestStepResultStatus) {\n return (x) => x\n },\n location: (x) => x,\n tag: (x) => x,\n diffAdded: (x) => x,\n diffRemoved: (x) => x,\n errorMessage: (x) => x,\n errorStack: (x) => x,\n }\n }\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import * as messages from '@cucumber/messages';
|
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
export interface ITestCaseAttempt {
|
|
5
5
|
attempt: number;
|
|
6
|
+
willBeRetried: boolean;
|
|
6
7
|
gherkinDocument: messages.GherkinDocument;
|
|
7
8
|
pickle: messages.Pickle;
|
|
8
9
|
stepAttachments: Record<string, messages.Attachment[]>;
|
|
@@ -25,5 +26,5 @@ export default class EventDataCollector {
|
|
|
25
26
|
private initTestCaseAttempt;
|
|
26
27
|
storeAttachment(attachment: messages.Attachment): void;
|
|
27
28
|
storeTestStepResult({ testCaseStartedId, testStepId, testStepResult, }: messages.TestStepFinished): void;
|
|
28
|
-
storeTestCaseResult({ testCaseStartedId }: messages.TestCaseFinished): void;
|
|
29
|
+
storeTestCaseResult({ testCaseStartedId, willBeRetried, }: messages.TestCaseFinished): void;
|
|
29
30
|
}
|