@cucumber/cucumber 7.3.0 → 8.0.0-rc.2
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 +11 -4
- package/lib/cli/argv_parser.d.ts +3 -3
- package/lib/cli/argv_parser.js +19 -19
- package/lib/cli/argv_parser.js.map +1 -1
- package/lib/cli/configuration_builder.d.ts +5 -46
- package/lib/cli/configuration_builder.js +61 -150
- package/lib/cli/configuration_builder.js.map +1 -1
- package/lib/cli/helpers.d.ts +5 -3
- package/lib/cli/helpers.js +42 -15
- 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 +4 -23
- package/lib/cli/index.js +18 -193
- 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/option_splitter.js +1 -0
- package/lib/cli/option_splitter.js.map +1 -1
- package/lib/cli/profile_loader.d.ts +3 -2
- package/lib/cli/profile_loader.js +20 -13
- package/lib/cli/profile_loader.js.map +1 -1
- package/lib/cli/publish_banner.js +1 -1
- package/lib/cli/publish_banner.js.map +1 -1
- package/lib/cli/run.js +3 -4
- package/lib/cli/run.js.map +1 -1
- package/lib/configuration/index.d.ts +1 -0
- package/lib/configuration/index.js +14 -0
- package/lib/configuration/index.js.map +1 -0
- package/lib/configuration/types.d.ts +29 -0
- package/lib/configuration/types.js +3 -0
- package/lib/configuration/types.js.map +1 -0
- package/lib/formatter/builder.d.ts +5 -4
- package/lib/formatter/builder.js +41 -55
- package/lib/formatter/builder.js.map +1 -1
- package/lib/formatter/get_color_fns.d.ts +4 -0
- package/lib/formatter/get_color_fns.js +11 -4
- 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 +2 -2
- 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 +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.js +12 -12
- package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_parser.js +17 -20
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
- package/lib/formatter/helpers/usage_helpers/index.js +26 -40
- 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 +1 -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 +17 -16
- 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 -2
- 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 +10 -10
- 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 -9
- 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 -2
- package/lib/formatter/usage_json_formatter.js.map +1 -1
- package/lib/importer.js +13 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -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/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/run/formatters.d.ts +14 -0
- package/lib/run/formatters.js +76 -0
- package/lib/run/formatters.js.map +1 -0
- package/lib/run/index.d.ts +2 -0
- package/lib/run/index.js +15 -0
- package/lib/run/index.js.map +1 -0
- package/lib/run/paths.d.ts +6 -0
- package/lib/run/paths.js +83 -0
- package/lib/run/paths.js.map +1 -0
- package/lib/run/runCucumber.d.ts +3 -0
- package/lib/run/runCucumber.js +88 -0
- package/lib/run/runCucumber.js.map +1 -0
- package/lib/run/runtime.d.ts +19 -0
- package/lib/run/runtime.js +58 -0
- package/lib/run/runtime.js.map +1 -0
- package/lib/run/support.d.ts +8 -0
- package/lib/run/support.js +26 -0
- package/lib/run/support.js.map +1 -0
- package/lib/run/types.d.ts +12 -0
- package/lib/run/types.js +3 -0
- package/lib/run/types.js.map +1 -0
- 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 +5 -3
- package/lib/runtime/index.js +22 -46
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/parallel/coordinator.d.ts +6 -5
- package/lib/runtime/parallel/coordinator.js +19 -22
- 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.js +21 -13
- package/lib/runtime/parallel/worker.js.map +1 -1
- 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.js +18 -31
- package/lib/support_code_library_builder/index.js.map +1 -1
- package/lib/support_code_library_builder/types.d.ts +2 -1
- 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 +38 -0
- package/package.json +77 -67
- package/CHANGELOG.md +0 -1908
- 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
|
@@ -1,41 +0,0 @@
|
|
|
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.buildParameterType = exports.getDefinitionLineAndUri = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const cucumber_expressions_1 = require("@cucumber/cucumber-expressions");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const stacktrace_js_1 = __importDefault(require("stacktrace-js"));
|
|
11
|
-
const stack_trace_filter_1 = require("../stack_trace_filter");
|
|
12
|
-
const value_checker_1 = require("../value_checker");
|
|
13
|
-
function getDefinitionLineAndUri(cwd) {
|
|
14
|
-
let line;
|
|
15
|
-
let uri;
|
|
16
|
-
const stackframes = stacktrace_js_1.default.getSync();
|
|
17
|
-
const stackframe = lodash_1.default.find(stackframes, (frame) => {
|
|
18
|
-
return !stack_trace_filter_1.isFileNameInCucumber(frame.getFileName());
|
|
19
|
-
});
|
|
20
|
-
if (value_checker_1.doesHaveValue(stackframe)) {
|
|
21
|
-
line = stackframe.getLineNumber();
|
|
22
|
-
uri = stackframe.getFileName();
|
|
23
|
-
if (value_checker_1.doesHaveValue(uri)) {
|
|
24
|
-
uri = path_1.default.relative(cwd, uri);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
line: value_checker_1.valueOrDefault(line, 0),
|
|
29
|
-
uri: value_checker_1.valueOrDefault(uri, 'unknown'),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.getDefinitionLineAndUri = getDefinitionLineAndUri;
|
|
33
|
-
function buildParameterType({ name, regexp, transformer, useForSnippets, preferForRegexpMatch, }) {
|
|
34
|
-
if (typeof useForSnippets !== 'boolean')
|
|
35
|
-
useForSnippets = true;
|
|
36
|
-
if (typeof preferForRegexpMatch !== 'boolean')
|
|
37
|
-
preferForRegexpMatch = false;
|
|
38
|
-
return new cucumber_expressions_1.ParameterType(name, regexp, null, transformer, useForSnippets, preferForRegexpMatch);
|
|
39
|
-
}
|
|
40
|
-
exports.buildParameterType = buildParameterType;
|
|
41
|
-
//# sourceMappingURL=build_helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build_helpers.js","sourceRoot":"","sources":["../../src/support_code_library_builder/build_helpers.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAsB;AACtB,yEAA8D;AAC9D,gDAAuB;AACvB,kEAAsC;AACtC,8DAA4D;AAC5D,oDAAgE;AAIhE,SAAgB,uBAAuB,CAAC,GAAW;IACjD,IAAI,IAAY,CAAA;IAChB,IAAI,GAAW,CAAA;IACf,MAAM,WAAW,GAAG,uBAAU,CAAC,OAAO,EAAE,CAAA;IACxC,MAAM,UAAU,GAAG,gBAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;QAC/C,OAAO,CAAC,yCAAoB,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;IACF,IAAI,6BAAa,CAAC,UAAU,CAAC,EAAE;QAC7B,IAAI,GAAG,UAAU,CAAC,aAAa,EAAE,CAAA;QACjC,GAAG,GAAG,UAAU,CAAC,WAAW,EAAE,CAAA;QAC9B,IAAI,6BAAa,CAAC,GAAG,CAAC,EAAE;YACtB,GAAG,GAAG,cAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;SAC9B;KACF;IACD,OAAO;QACL,IAAI,EAAE,8BAAc,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7B,GAAG,EAAE,8BAAc,CAAC,GAAG,EAAE,SAAS,CAAC;KACpC,CAAA;AACH,CAAC;AAlBD,0DAkBC;AAED,SAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,MAAM,EACN,WAAW,EACX,cAAc,EACd,oBAAoB,GACU;IAC9B,IAAI,OAAO,cAAc,KAAK,SAAS;QAAE,cAAc,GAAG,IAAI,CAAA;IAC9D,IAAI,OAAO,oBAAoB,KAAK,SAAS;QAAE,oBAAoB,GAAG,KAAK,CAAA;IAC3E,OAAO,IAAI,oCAAa,CACtB,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,cAAc,EACd,oBAAoB,CACrB,CAAA;AACH,CAAC;AAjBD,gDAiBC","sourcesContent":["import _ from 'lodash'\nimport { ParameterType } from '@cucumber/cucumber-expressions'\nimport path from 'path'\nimport StackTrace from 'stacktrace-js'\nimport { isFileNameInCucumber } from '../stack_trace_filter'\nimport { doesHaveValue, valueOrDefault } from '../value_checker'\nimport { ILineAndUri } from '../types'\nimport { IParameterTypeDefinition } from './types'\n\nexport function getDefinitionLineAndUri(cwd: string): ILineAndUri {\n let line: number\n let uri: string\n const stackframes = StackTrace.getSync()\n const stackframe = _.find(stackframes, (frame) => {\n return !isFileNameInCucumber(frame.getFileName())\n })\n if (doesHaveValue(stackframe)) {\n line = stackframe.getLineNumber()\n uri = stackframe.getFileName()\n if (doesHaveValue(uri)) {\n uri = path.relative(cwd, uri)\n }\n }\n return {\n line: valueOrDefault(line, 0),\n uri: valueOrDefault(uri, 'unknown'),\n }\n}\n\nexport function buildParameterType({\n name,\n regexp,\n transformer,\n useForSnippets,\n preferForRegexpMatch,\n}: IParameterTypeDefinition<any>): ParameterType<any> {\n if (typeof useForSnippets !== 'boolean') useForSnippets = true\n if (typeof preferForRegexpMatch !== 'boolean') preferForRegexpMatch = false\n return new ParameterType(\n name,\n regexp,\n null,\n transformer,\n useForSnippets,\n preferForRegexpMatch\n )\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface IDefinitionConfig {
|
|
2
|
-
code: any;
|
|
3
|
-
line: number;
|
|
4
|
-
uri: string;
|
|
5
|
-
}
|
|
6
|
-
export interface IValidateNoGeneratorFunctionsRequest {
|
|
7
|
-
cwd: string;
|
|
8
|
-
definitionConfigs: IDefinitionConfig[];
|
|
9
|
-
}
|
|
10
|
-
export declare function validateNoGeneratorFunctions({ cwd, definitionConfigs, }: IValidateNoGeneratorFunctionsRequest): void;
|
|
@@ -1,26 +0,0 @@
|
|
|
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.validateNoGeneratorFunctions = void 0;
|
|
7
|
-
const is_generator_1 = __importDefault(require("is-generator"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
function validateNoGeneratorFunctions({ cwd, definitionConfigs, }) {
|
|
10
|
-
const generatorDefinitionConfigs = definitionConfigs.filter((definitionConfig) => is_generator_1.default.fn(definitionConfig.code));
|
|
11
|
-
if (generatorDefinitionConfigs.length > 0) {
|
|
12
|
-
const references = generatorDefinitionConfigs
|
|
13
|
-
.map((definitionConfig) => `${path_1.default.relative(cwd, definitionConfig.uri)}:${definitionConfig.line.toString()}`)
|
|
14
|
-
.join('\n ');
|
|
15
|
-
const message = `
|
|
16
|
-
The following hook/step definitions use generator functions:
|
|
17
|
-
|
|
18
|
-
${references}
|
|
19
|
-
|
|
20
|
-
Use 'this.setDefinitionFunctionWrapper(fn)' to wrap them in a function that returns a promise.
|
|
21
|
-
`;
|
|
22
|
-
throw new Error(message);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.validateNoGeneratorFunctions = validateNoGeneratorFunctions;
|
|
26
|
-
//# sourceMappingURL=finalize_helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"finalize_helpers.js","sourceRoot":"","sources":["../../src/support_code_library_builder/finalize_helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAsC;AACtC,gDAAuB;AAavB,SAAgB,4BAA4B,CAAC,EAC3C,GAAG,EACH,iBAAiB,GACoB;IACrC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,MAAM,CACzD,CAAC,gBAAgB,EAAE,EAAE,CAAC,sBAAW,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAC5D,CAAA;IACD,IAAI,0BAA0B,CAAC,MAAM,GAAG,CAAC,EAAE;QACzC,MAAM,UAAU,GAAG,0BAA0B;aAC1C,GAAG,CACF,CAAC,gBAAgB,EAAE,EAAE,CACnB,GAAG,cAAI,CAAC,QAAQ,CACd,GAAG,EACH,gBAAgB,CAAC,GAAG,CACrB,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAC1C;aACA,IAAI,CAAC,MAAM,CAAC,CAAA;QACf,MAAM,OAAO,GAAG;;;UAGV,UAAU;;;OAGb,CAAA;QACH,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;KACzB;AACH,CAAC;AA1BD,oEA0BC","sourcesContent":["import isGenerator from 'is-generator'\nimport path from 'path'\n\nexport interface IDefinitionConfig {\n code: any\n line: number\n uri: string\n}\n\nexport interface IValidateNoGeneratorFunctionsRequest {\n cwd: string\n definitionConfigs: IDefinitionConfig[]\n}\n\nexport function validateNoGeneratorFunctions({\n cwd,\n definitionConfigs,\n}: IValidateNoGeneratorFunctionsRequest): void {\n const generatorDefinitionConfigs = definitionConfigs.filter(\n (definitionConfig) => isGenerator.fn(definitionConfig.code)\n )\n if (generatorDefinitionConfigs.length > 0) {\n const references = generatorDefinitionConfigs\n .map(\n (definitionConfig) =>\n `${path.relative(\n cwd,\n definitionConfig.uri\n )}:${definitionConfig.line.toString()}`\n )\n .join('\\n ')\n const message = `\n The following hook/step definitions use generator functions:\n\n ${references}\n\n Use 'this.setDefinitionFunctionWrapper(fn)' to wrap them in a function that returns a promise.\n `\n throw new Error(message)\n }\n}\n"]}
|