@lynxwall/cucumber-tsflow 6.0.2 → 6.1.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/bin/cucumber-tsflow +0 -0
- package/lib/behave.d.ts +1 -1
- package/lib/behave.js +27 -27
- package/lib/cli/argv-parser.d.ts +24 -24
- package/lib/cli/argv-parser.js +103 -103
- package/lib/cli/index.d.ts +22 -22
- package/lib/cli/index.js +100 -100
- package/lib/cli/load-configuration.d.ts +20 -20
- package/lib/cli/load-configuration.js +92 -92
- package/lib/cli/run.d.ts +1 -1
- package/lib/cli/run.js +47 -49
- package/lib/cucumber/binding-decorator.d.ts +10 -10
- package/lib/cucumber/binding-decorator.js +180 -180
- package/lib/cucumber/binding-registry.d.ts +82 -82
- package/lib/cucumber/binding-registry.js +215 -215
- package/lib/cucumber/hook-decorators.d.ts +46 -46
- package/lib/cucumber/hook-decorators.js +102 -102
- package/lib/cucumber/managed-scenario-context.d.ts +21 -21
- package/lib/cucumber/managed-scenario-context.js +95 -95
- package/lib/cucumber/message-collector.d.ts +81 -81
- package/lib/cucumber/message-collector.js +250 -250
- package/lib/cucumber/parallel/coordinator.d.ts +79 -79
- package/lib/cucumber/parallel/coordinator.js +246 -246
- package/lib/cucumber/parallel/run-worker.d.ts +1 -1
- package/lib/cucumber/parallel/run-worker.js +31 -31
- package/lib/cucumber/parallel/worker.d.ts +30 -30
- package/lib/cucumber/parallel/worker.js +103 -103
- package/lib/cucumber/run-cucumber.d.ts +14 -14
- package/lib/cucumber/run-cucumber.js +117 -117
- package/lib/cucumber/runtime.d.ts +25 -25
- package/lib/cucumber/runtime.js +39 -39
- package/lib/cucumber/step-definition-decorators.d.ts +24 -24
- package/lib/cucumber/step-definition-decorators.js +91 -91
- package/lib/cucumber/utils.d.ts +16 -16
- package/lib/cucumber/utils.js +77 -77
- package/lib/esnode.js +18 -18
- package/lib/esvue.d.ts +1 -1
- package/lib/esvue.js +40 -40
- package/lib/formatters/behave-json-formatter.d.ts +49 -49
- package/lib/formatters/behave-json-formatter.js +74 -74
- package/lib/formatters/tsflow-snippet-syntax.d.ts +9 -9
- package/lib/formatters/tsflow-snippet-syntax.js +89 -89
- package/lib/gherkin/configuration.d.ts +30 -30
- package/lib/gherkin/configuration.js +26 -26
- package/lib/gherkin/gherkin-feature.d.ts +28 -28
- package/lib/gherkin/gherkin-feature.js +333 -333
- package/lib/gherkin/gherkin-manager.d.ts +29 -29
- package/lib/gherkin/gherkin-manager.js +139 -114
- package/lib/gherkin/models.d.ts +45 -45
- package/lib/gherkin/models.js +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +22 -22
- package/lib/snippet.d.ts +1 -1
- package/lib/snippet.js +27 -27
- package/lib/transpilers/esbuild-transpiler.d.ts +4 -4
- package/lib/transpilers/esbuild-transpiler.js +18 -18
- package/lib/transpilers/esbuild.d.ts +12 -12
- package/lib/transpilers/esbuild.js +54 -54
- package/lib/transpilers/vue-sfc/compiler.d.ts +7 -7
- package/lib/transpilers/vue-sfc/compiler.js +21 -21
- package/lib/transpilers/vue-sfc/index.d.ts +23 -23
- package/lib/transpilers/vue-sfc/index.js +46 -46
- package/lib/transpilers/vue-sfc/main.d.ts +8 -8
- package/lib/transpilers/vue-sfc/main.js +247 -247
- package/lib/transpilers/vue-sfc/script.d.ts +5 -5
- package/lib/transpilers/vue-sfc/script.js +41 -41
- package/lib/transpilers/vue-sfc/template.d.ts +8 -8
- package/lib/transpilers/vue-sfc/template.js +101 -101
- package/lib/transpilers/vue-sfc/types.d.ts +55 -55
- package/lib/transpilers/vue-sfc/types.js +2 -2
- package/lib/transpilers/vue-sfc/utils/descriptorCache.d.ts +13 -13
- package/lib/transpilers/vue-sfc/utils/descriptorCache.js +67 -67
- package/lib/transpilers/vue-sfc/utils/error.d.ts +3 -3
- package/lib/transpilers/vue-sfc/utils/error.js +22 -22
- package/lib/transpilers/vue-sfc/utils/query.d.ts +13 -13
- package/lib/transpilers/vue-sfc/utils/query.js +35 -35
- package/lib/tsnode.js +17 -17
- package/lib/tsvue.d.ts +1 -1
- package/lib/tsvue.js +39 -39
- package/lib/types/scenario-context.d.ts +16 -16
- package/lib/types/scenario-context.js +17 -17
- package/lib/types/scenario-info.d.ts +16 -16
- package/lib/types/scenario-info.js +22 -22
- package/lib/types/step-binding-flags.d.ts +53 -53
- package/lib/types/step-binding-flags.js +58 -58
- package/lib/types/step-binding.d.ts +50 -50
- package/lib/types/step-binding.js +17 -17
- package/lib/types/types.d.ts +21 -21
- package/lib/types/types.js +2 -2
- package/lib/utils/helpers.d.ts +6 -6
- package/lib/utils/helpers.js +17 -17
- package/lib/utils/logger.d.ts +3 -3
- package/lib/utils/logger.js +29 -29
- package/lib/utils/our-callsite.d.ts +27 -27
- package/lib/utils/our-callsite.js +72 -72
- package/lib/version.d.ts +1 -1
- package/lib/version.js +5 -5
- package/package.json +1 -1
package/bin/cucumber-tsflow
CHANGED
|
File without changes
|
package/lib/behave.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/lib/behave.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const behave = __importStar(require("./formatters/behave-json-formatter"));
|
|
27
|
-
module.exports = behave;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const behave = __importStar(require("./formatters/behave-json-formatter"));
|
|
27
|
+
module.exports = behave;
|
|
28
28
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVoYXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2JlaGF2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkVBQTZEO0FBRTdELE1BQU0sQ0FBQyxPQUFPLEdBQUcsTUFBTSxDQUFDIn0=
|
package/lib/cli/argv-parser.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { IConfiguration } from '@cucumber/cucumber/lib/configuration/types';
|
|
2
|
-
export interface IParsedArgvOptions {
|
|
3
|
-
config?: string;
|
|
4
|
-
i18nKeywords?: string;
|
|
5
|
-
i18nLanguages?: boolean;
|
|
6
|
-
profile?: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface ITsflowConfiguration extends IConfiguration {
|
|
9
|
-
debugFile: string;
|
|
10
|
-
transpiler: string;
|
|
11
|
-
}
|
|
12
|
-
export interface IParsedArgv {
|
|
13
|
-
options: IParsedArgvOptions;
|
|
14
|
-
configuration: Partial<ITsflowConfiguration>;
|
|
15
|
-
}
|
|
16
|
-
declare const ArgvParser: {
|
|
17
|
-
collect<T>(val: T, memo?: T[]): T[] | undefined;
|
|
18
|
-
mergeJson(option: string): (str: string, memo?: object) => object;
|
|
19
|
-
mergeTags(value: string, memo?: string): string;
|
|
20
|
-
validateCountOption(value: string, optionName: string): number;
|
|
21
|
-
validateLanguage(value: string): string;
|
|
22
|
-
parse(argv: string[]): IParsedArgv;
|
|
23
|
-
};
|
|
24
|
-
export default ArgvParser;
|
|
1
|
+
import { IConfiguration } from '@cucumber/cucumber/lib/configuration/types';
|
|
2
|
+
export interface IParsedArgvOptions {
|
|
3
|
+
config?: string;
|
|
4
|
+
i18nKeywords?: string;
|
|
5
|
+
i18nLanguages?: boolean;
|
|
6
|
+
profile?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ITsflowConfiguration extends IConfiguration {
|
|
9
|
+
debugFile: string;
|
|
10
|
+
transpiler: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IParsedArgv {
|
|
13
|
+
options: IParsedArgvOptions;
|
|
14
|
+
configuration: Partial<ITsflowConfiguration>;
|
|
15
|
+
}
|
|
16
|
+
declare const ArgvParser: {
|
|
17
|
+
collect<T>(val: T, memo?: T[]): T[] | undefined;
|
|
18
|
+
mergeJson(option: string): (str: string, memo?: object) => object;
|
|
19
|
+
mergeTags(value: string, memo?: string): string;
|
|
20
|
+
validateCountOption(value: string, optionName: string): number;
|
|
21
|
+
validateLanguage(value: string): string;
|
|
22
|
+
parse(argv: string[]): IParsedArgv;
|
|
23
|
+
};
|
|
24
|
+
export default ArgvParser;
|
package/lib/cli/argv-parser.js
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const commander_1 = require("commander");
|
|
7
|
-
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const gherkin_1 = require("@cucumber/gherkin");
|
|
10
|
-
const formatters_1 = __importDefault(require("@cucumber/cucumber/lib/formatter/helpers/formatters"));
|
|
11
|
-
const version_1 = require("../version");
|
|
12
|
-
const ArgvParser = {
|
|
13
|
-
collect(val, memo = []) {
|
|
14
|
-
if (val) {
|
|
15
|
-
return [...memo, val];
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
},
|
|
19
|
-
mergeJson(option) {
|
|
20
|
-
return function (str, memo = {}) {
|
|
21
|
-
let val;
|
|
22
|
-
try {
|
|
23
|
-
val = JSON.parse(str);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
const e = error;
|
|
27
|
-
throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`);
|
|
28
|
-
}
|
|
29
|
-
if (typeof val !== 'object' || Array.isArray(val)) {
|
|
30
|
-
throw new Error(`${option} must be passed JSON of an object: ${str}`);
|
|
31
|
-
}
|
|
32
|
-
return (0, lodash_merge_1.default)(memo, val);
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
mergeTags(value, memo) {
|
|
36
|
-
return memo ? `${memo} and (${value})` : `(${value})`;
|
|
37
|
-
},
|
|
38
|
-
validateCountOption(value, optionName) {
|
|
39
|
-
const numericValue = parseInt(value);
|
|
40
|
-
if (isNaN(numericValue) || numericValue < 0) {
|
|
41
|
-
throw new Error(`${optionName} must be a non negative integer`);
|
|
42
|
-
}
|
|
43
|
-
return numericValue;
|
|
44
|
-
},
|
|
45
|
-
validateLanguage(value) {
|
|
46
|
-
if (!Object.keys(gherkin_1.dialects).includes(value)) {
|
|
47
|
-
throw new Error(`Unsupported ISO 639-1: ${value}`);
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
},
|
|
51
|
-
parse(argv) {
|
|
52
|
-
const program = new commander_1.Command(path_1.default.basename(argv[1]));
|
|
53
|
-
program
|
|
54
|
-
.storeOptionsAsProperties(false)
|
|
55
|
-
.usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')
|
|
56
|
-
.version(version_1.version, '-v, --version')
|
|
57
|
-
.option('-b, --backtrace', 'show full backtrace for errors')
|
|
58
|
-
.option('-c, --config <PATH>', 'specify configuration file')
|
|
59
|
-
.option('-d, --dry-run', 'invoke formatters without executing steps')
|
|
60
|
-
.option('--debug-file <STRING>', 'path to a file with steps for debugging')
|
|
61
|
-
.option('--exit, --force-exit', 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit')
|
|
62
|
-
.option('--fail-fast', 'abort the run on first failure')
|
|
63
|
-
.option('-f, --format <TYPE[:PATH]>', 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\n' +
|
|
64
|
-
formatters_1.default.buildFormattersDocumentationString(), ArgvParser.collect)
|
|
65
|
-
.option('--format-options <JSON>', 'provide options for formatters (repeatable)', ArgvParser.mergeJson('--format-options'))
|
|
66
|
-
.option('--i18n-keywords <ISO 639-1>', 'list language keywords', ArgvParser.validateLanguage)
|
|
67
|
-
.option('--i18n-languages', 'list languages')
|
|
68
|
-
.option('-i, --import <GLOB|DIR|FILE>', 'import files before executing features (repeatable)', ArgvParser.collect)
|
|
69
|
-
.option('--language <ISO 639-1>', 'provide the default language for feature files')
|
|
70
|
-
.option('--name <REGEXP>', 'only execute the scenarios with name matching the expression (repeatable)', ArgvParser.collect)
|
|
71
|
-
.option('--order <TYPE[:SEED]>', 'run scenarios in the specified order. Type should be `defined` or `random`')
|
|
72
|
-
.option('-p, --profile <NAME>', 'specify the profile to use (repeatable)', ArgvParser.collect, [])
|
|
73
|
-
.option('--parallel <NUMBER_OF_WORKERS>', 'run in parallel with the given number of workers', val => ArgvParser.validateCountOption(val, '--parallel'))
|
|
74
|
-
.option('--publish', 'Publish a report to https://reports.cucumber.io')
|
|
75
|
-
.option('--publish-quiet', "Don't print information banner about publishing reports")
|
|
76
|
-
.option('-r, --require <GLOB|DIR|FILE>', 'require files before executing features (repeatable)', ArgvParser.collect)
|
|
77
|
-
.option('--require-module <NODE_MODULE>', 'require node modules before requiring files (repeatable)', ArgvParser.collect)
|
|
78
|
-
.option('--retry <NUMBER_OF_RETRIES>', 'specify the number of times to retry failing test cases (default: 0)', val => ArgvParser.validateCountOption(val, '--retry'))
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const commander_1 = require("commander");
|
|
7
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const gherkin_1 = require("@cucumber/gherkin");
|
|
10
|
+
const formatters_1 = __importDefault(require("@cucumber/cucumber/lib/formatter/helpers/formatters"));
|
|
11
|
+
const version_1 = require("../version");
|
|
12
|
+
const ArgvParser = {
|
|
13
|
+
collect(val, memo = []) {
|
|
14
|
+
if (val) {
|
|
15
|
+
return [...memo, val];
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
},
|
|
19
|
+
mergeJson(option) {
|
|
20
|
+
return function (str, memo = {}) {
|
|
21
|
+
let val;
|
|
22
|
+
try {
|
|
23
|
+
val = JSON.parse(str);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
const e = error;
|
|
27
|
+
throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`);
|
|
28
|
+
}
|
|
29
|
+
if (typeof val !== 'object' || Array.isArray(val)) {
|
|
30
|
+
throw new Error(`${option} must be passed JSON of an object: ${str}`);
|
|
31
|
+
}
|
|
32
|
+
return (0, lodash_merge_1.default)(memo, val);
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
mergeTags(value, memo) {
|
|
36
|
+
return memo ? `${memo} and (${value})` : `(${value})`;
|
|
37
|
+
},
|
|
38
|
+
validateCountOption(value, optionName) {
|
|
39
|
+
const numericValue = parseInt(value);
|
|
40
|
+
if (isNaN(numericValue) || numericValue < 0) {
|
|
41
|
+
throw new Error(`${optionName} must be a non negative integer`);
|
|
42
|
+
}
|
|
43
|
+
return numericValue;
|
|
44
|
+
},
|
|
45
|
+
validateLanguage(value) {
|
|
46
|
+
if (!Object.keys(gherkin_1.dialects).includes(value)) {
|
|
47
|
+
throw new Error(`Unsupported ISO 639-1: ${value}`);
|
|
48
|
+
}
|
|
49
|
+
return value;
|
|
50
|
+
},
|
|
51
|
+
parse(argv) {
|
|
52
|
+
const program = new commander_1.Command(path_1.default.basename(argv[1]));
|
|
53
|
+
program
|
|
54
|
+
.storeOptionsAsProperties(false)
|
|
55
|
+
.usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')
|
|
56
|
+
.version(version_1.version, '-v, --version')
|
|
57
|
+
.option('-b, --backtrace', 'show full backtrace for errors')
|
|
58
|
+
.option('-c, --config <PATH>', 'specify configuration file')
|
|
59
|
+
.option('-d, --dry-run', 'invoke formatters without executing steps')
|
|
60
|
+
.option('--debug-file <STRING>', 'path to a file with steps for debugging')
|
|
61
|
+
.option('--exit, --force-exit', 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit')
|
|
62
|
+
.option('--fail-fast', 'abort the run on first failure')
|
|
63
|
+
.option('-f, --format <TYPE[:PATH]>', 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\n' +
|
|
64
|
+
formatters_1.default.buildFormattersDocumentationString(), ArgvParser.collect)
|
|
65
|
+
.option('--format-options <JSON>', 'provide options for formatters (repeatable)', ArgvParser.mergeJson('--format-options'))
|
|
66
|
+
.option('--i18n-keywords <ISO 639-1>', 'list language keywords', ArgvParser.validateLanguage)
|
|
67
|
+
.option('--i18n-languages', 'list languages')
|
|
68
|
+
.option('-i, --import <GLOB|DIR|FILE>', 'import files before executing features (repeatable)', ArgvParser.collect)
|
|
69
|
+
.option('--language <ISO 639-1>', 'provide the default language for feature files')
|
|
70
|
+
.option('--name <REGEXP>', 'only execute the scenarios with name matching the expression (repeatable)', ArgvParser.collect)
|
|
71
|
+
.option('--order <TYPE[:SEED]>', 'run scenarios in the specified order. Type should be `defined` or `random`')
|
|
72
|
+
.option('-p, --profile <NAME>', 'specify the profile to use (repeatable)', ArgvParser.collect, [])
|
|
73
|
+
.option('--parallel <NUMBER_OF_WORKERS>', 'run in parallel with the given number of workers', val => ArgvParser.validateCountOption(val, '--parallel'))
|
|
74
|
+
.option('--publish', 'Publish a report to https://reports.cucumber.io')
|
|
75
|
+
.option('--publish-quiet', "Don't print information banner about publishing reports")
|
|
76
|
+
.option('-r, --require <GLOB|DIR|FILE>', 'require files before executing features (repeatable)', ArgvParser.collect)
|
|
77
|
+
.option('--require-module <NODE_MODULE>', 'require node modules before requiring files (repeatable)', ArgvParser.collect)
|
|
78
|
+
.option('--retry <NUMBER_OF_RETRIES>', 'specify the number of times to retry failing test cases (default: 0)', val => ArgvParser.validateCountOption(val, '--retry'))
|
|
79
79
|
.option('--retry-tag-filter <EXPRESSION>', `only retries the features or scenarios with tags matching the expression (repeatable).
|
|
80
|
-
This option requires '--retry' to be specified.`, ArgvParser.mergeTags)
|
|
81
|
-
.option('--strict', 'fail if there are pending steps')
|
|
82
|
-
.option('--no-strict', 'succeed even if there are pending steps')
|
|
83
|
-
.option('-t, --tags <EXPRESSION>', 'only execute the features or scenarios with tags matching the expression (repeatable)', ArgvParser.mergeTags)
|
|
80
|
+
This option requires '--retry' to be specified.`, ArgvParser.mergeTags)
|
|
81
|
+
.option('--strict', 'fail if there are pending steps')
|
|
82
|
+
.option('--no-strict', 'succeed even if there are pending steps')
|
|
83
|
+
.option('-t, --tags <EXPRESSION>', 'only execute the features or scenarios with tags matching the expression (repeatable)', ArgvParser.mergeTags)
|
|
84
84
|
.option('--transpiler <ESNODE|TSNODE|ESVUE|TSVUE>', `built-in transpiler to use. ESxxx transpilers use esbuild and TSxxx transpilers use typescript.\n
|
|
85
85
|
Vue versions of the transpilers add a hook for .vue transforms and initialize jsdom globally.\n
|
|
86
|
-
Default: ESNODE (esbuild without Vue support)`)
|
|
87
|
-
.option('--world-parameters <JSON>', 'provide parameters that will be passed to the world constructor (repeatable)', ArgvParser.mergeJson('--world-parameters'));
|
|
88
|
-
program.addHelpText('afterAll', 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md');
|
|
89
|
-
program.parse(argv);
|
|
90
|
-
const { config, i18nKeywords, i18nLanguages, profile, ...regularStuff } = program.opts();
|
|
91
|
-
const configuration = regularStuff;
|
|
92
|
-
if (program.args.length > 0) {
|
|
93
|
-
configuration.paths = program.args;
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
options: {
|
|
97
|
-
config,
|
|
98
|
-
i18nKeywords,
|
|
99
|
-
i18nLanguages,
|
|
100
|
-
profile
|
|
101
|
-
},
|
|
102
|
-
configuration
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
exports.default = ArgvParser;
|
|
86
|
+
Default: ESNODE (esbuild without Vue support)`)
|
|
87
|
+
.option('--world-parameters <JSON>', 'provide parameters that will be passed to the world constructor (repeatable)', ArgvParser.mergeJson('--world-parameters'));
|
|
88
|
+
program.addHelpText('afterAll', 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md');
|
|
89
|
+
program.parse(argv);
|
|
90
|
+
const { config, i18nKeywords, i18nLanguages, profile, ...regularStuff } = program.opts();
|
|
91
|
+
const configuration = regularStuff;
|
|
92
|
+
if (program.args.length > 0) {
|
|
93
|
+
configuration.paths = program.args;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
options: {
|
|
97
|
+
config,
|
|
98
|
+
i18nKeywords,
|
|
99
|
+
i18nLanguages,
|
|
100
|
+
profile
|
|
101
|
+
},
|
|
102
|
+
configuration
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.default = ArgvParser;
|
|
107
107
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJndi1wYXJzZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2FyZ3YtcGFyc2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEseUNBQW9DO0FBQ3BDLGdFQUFpQztBQUNqQyxnREFBd0I7QUFDeEIsK0NBQTZDO0FBQzdDLHFHQUE2RTtBQUM3RSx3Q0FB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FFLEdBQUcsWUFBWSxFQUFFLEdBQW9CLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUMxRyxNQUFNLGFBQWEsR0FBa0MsWUFBWSxDQUFDO1FBQ2xFLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFO1lBQzVCLGFBQWEsQ0FBQyxLQUFLLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQztTQUNuQztRQUVELE9BQU87WUFDTixPQUFPLEVBQUU7Z0JBQ1IsTUFBTTtnQkFDTixZQUFZO2dCQUNaLGFBQWE7Z0JBQ2IsT0FBTzthQUNQO1lBQ0QsYUFBYTtTQUNiLENBQUM7SUFDSCxDQUFDO0NBQ0QsQ0FBQztBQUVGLGtCQUFlLFVBQVUsQ0FBQyJ9
|
package/lib/cli/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IFormatterStream } from '@cucumber/cucumber/lib/formatter';
|
|
3
|
-
export interface ICliRunResult {
|
|
4
|
-
shouldAdvertisePublish: boolean;
|
|
5
|
-
shouldExitImmediately: boolean;
|
|
6
|
-
success: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default class Cli {
|
|
9
|
-
private readonly argv;
|
|
10
|
-
private readonly cwd;
|
|
11
|
-
private readonly stdout;
|
|
12
|
-
private readonly stderr;
|
|
13
|
-
private readonly env;
|
|
14
|
-
constructor({ argv, cwd, stdout, stderr, env }: {
|
|
15
|
-
argv: string[];
|
|
16
|
-
cwd: string;
|
|
17
|
-
stdout: IFormatterStream;
|
|
18
|
-
stderr: IFormatterStream;
|
|
19
|
-
env: NodeJS.ProcessEnv;
|
|
20
|
-
});
|
|
21
|
-
run(): Promise<ICliRunResult>;
|
|
22
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IFormatterStream } from '@cucumber/cucumber/lib/formatter';
|
|
3
|
+
export interface ICliRunResult {
|
|
4
|
+
shouldAdvertisePublish: boolean;
|
|
5
|
+
shouldExitImmediately: boolean;
|
|
6
|
+
success: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default class Cli {
|
|
9
|
+
private readonly argv;
|
|
10
|
+
private readonly cwd;
|
|
11
|
+
private readonly stdout;
|
|
12
|
+
private readonly stderr;
|
|
13
|
+
private readonly env;
|
|
14
|
+
constructor({ argv, cwd, stdout, stderr, env }: {
|
|
15
|
+
argv: string[];
|
|
16
|
+
cwd: string;
|
|
17
|
+
stdout: IFormatterStream;
|
|
18
|
+
stderr: IFormatterStream;
|
|
19
|
+
env: NodeJS.ProcessEnv;
|
|
20
|
+
});
|
|
21
|
+
run(): Promise<ICliRunResult>;
|
|
22
|
+
}
|
package/lib/cli/index.js
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const messages_1 = require("@cucumber/messages");
|
|
7
|
-
const index_1 = require("@cucumber/cucumber/lib/configuration/index");
|
|
8
|
-
const run_cucumber_1 = require("../cucumber/run-cucumber");
|
|
9
|
-
const load_configuration_1 = require("./load-configuration");
|
|
10
|
-
const i18n_1 = require("@cucumber/cucumber/lib/cli/i18n");
|
|
11
|
-
const install_validator_1 = require("@cucumber/cucumber/lib/cli/install_validator");
|
|
12
|
-
const paths_1 = require("@cucumber/cucumber/lib/api/paths");
|
|
13
|
-
const environment_1 = require("@cucumber/cucumber/lib/api/environment");
|
|
14
|
-
const support_1 = require("@cucumber/cucumber/lib/api/support");
|
|
15
|
-
const binding_registry_1 = require("../cucumber/binding-registry");
|
|
16
|
-
const argv_parser_1 = __importDefault(require("./argv-parser"));
|
|
17
|
-
const debug_1 = __importDefault(require("debug"));
|
|
18
|
-
const console_logger_1 = require("@cucumber/cucumber/lib/api/console_logger");
|
|
19
|
-
const console_1 = require("console");
|
|
20
|
-
class Cli {
|
|
21
|
-
argv;
|
|
22
|
-
cwd;
|
|
23
|
-
stdout;
|
|
24
|
-
stderr;
|
|
25
|
-
env;
|
|
26
|
-
constructor({ argv, cwd, stdout, stderr, env }) {
|
|
27
|
-
this.argv = argv;
|
|
28
|
-
this.cwd = cwd;
|
|
29
|
-
this.stdout = stdout;
|
|
30
|
-
this.stderr = stderr;
|
|
31
|
-
this.env = env;
|
|
32
|
-
}
|
|
33
|
-
async run() {
|
|
34
|
-
await (0, install_validator_1.validateInstall)();
|
|
35
|
-
const { options, configuration: argvConfiguration } = argv_parser_1.default.parse(this.argv);
|
|
36
|
-
if (options.i18nLanguages) {
|
|
37
|
-
this.stdout.write((0, i18n_1.getLanguages)());
|
|
38
|
-
return {
|
|
39
|
-
shouldAdvertisePublish: false,
|
|
40
|
-
shouldExitImmediately: true,
|
|
41
|
-
success: true
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
if (options.i18nKeywords) {
|
|
45
|
-
this.stdout.write((0, i18n_1.getKeywords)(options.i18nKeywords));
|
|
46
|
-
return {
|
|
47
|
-
shouldAdvertisePublish: false,
|
|
48
|
-
shouldExitImmediately: true,
|
|
49
|
-
success: true
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
const enableDebug = debug_1.default.enabled('cucumber');
|
|
53
|
-
const environment = {
|
|
54
|
-
cwd: this.cwd,
|
|
55
|
-
stdout: this.stdout,
|
|
56
|
-
stderr: this.stderr,
|
|
57
|
-
env: this.env,
|
|
58
|
-
debug: enableDebug
|
|
59
|
-
};
|
|
60
|
-
const consoleLogger = new console_1.Console(environment.stdout, environment.stderr);
|
|
61
|
-
consoleLogger.info('Loading configuration and step definitions...\n');
|
|
62
|
-
const { useConfiguration: configuration, runConfiguration } = await (0, load_configuration_1.loadConfiguration)({
|
|
63
|
-
file: options.config,
|
|
64
|
-
profiles: options.profile,
|
|
65
|
-
provided: argvConfiguration
|
|
66
|
-
}, environment);
|
|
67
|
-
// get run options
|
|
68
|
-
const { cwd } = (0, environment_1.mergeEnvironment)(environment);
|
|
69
|
-
const newId = messages_1.IdGenerator.uuid();
|
|
70
|
-
const runOptions = runConfiguration;
|
|
71
|
-
const supportCoordinates = 'World' in runOptions.support ? runOptions.support.originalCoordinates : runOptions.support;
|
|
72
|
-
const logger = new console_logger_1.ConsoleLogger(environment.stderr, enableDebug);
|
|
73
|
-
const { requirePaths, importPaths } = await (0, paths_1.resolvePaths)(logger, cwd, runOptions.sources, supportCoordinates);
|
|
74
|
-
// Load the step and hook definitions
|
|
75
|
-
const supportCodeLibrary = 'World' in runOptions.support
|
|
76
|
-
? runOptions.support
|
|
77
|
-
: await (0, support_1.getSupportCodeLibrary)({
|
|
78
|
-
cwd,
|
|
79
|
-
newId,
|
|
80
|
-
requirePaths,
|
|
81
|
-
importPaths,
|
|
82
|
-
requireModules: supportCoordinates.requireModules
|
|
83
|
-
});
|
|
84
|
-
// Set support to the updated step and hook definitions
|
|
85
|
-
// in the supportCodeLibrary. We also need to initialize originalCoordinates
|
|
86
|
-
// to support parallel execution.
|
|
87
|
-
runOptions.support = binding_registry_1.BindingRegistry.instance.updateSupportCodeLibrary(supportCodeLibrary);
|
|
88
|
-
runOptions.support = { ...runOptions.support, ...{ originalCoordinates: supportCoordinates } };
|
|
89
|
-
// now we can run cucumber
|
|
90
|
-
const { success } = await (0, run_cucumber_1.runCucumber)(runOptions, environment);
|
|
91
|
-
return {
|
|
92
|
-
shouldAdvertisePublish: !runConfiguration.formats.publish &&
|
|
93
|
-
!configuration.publishQuiet &&
|
|
94
|
-
!(0, index_1.isTruthyString)(this.env.CUCUMBER_PUBLISH_QUIET),
|
|
95
|
-
shouldExitImmediately: configuration.forceExit,
|
|
96
|
-
success
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
exports.default = Cli;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const messages_1 = require("@cucumber/messages");
|
|
7
|
+
const index_1 = require("@cucumber/cucumber/lib/configuration/index");
|
|
8
|
+
const run_cucumber_1 = require("../cucumber/run-cucumber");
|
|
9
|
+
const load_configuration_1 = require("./load-configuration");
|
|
10
|
+
const i18n_1 = require("@cucumber/cucumber/lib/cli/i18n");
|
|
11
|
+
const install_validator_1 = require("@cucumber/cucumber/lib/cli/install_validator");
|
|
12
|
+
const paths_1 = require("@cucumber/cucumber/lib/api/paths");
|
|
13
|
+
const environment_1 = require("@cucumber/cucumber/lib/api/environment");
|
|
14
|
+
const support_1 = require("@cucumber/cucumber/lib/api/support");
|
|
15
|
+
const binding_registry_1 = require("../cucumber/binding-registry");
|
|
16
|
+
const argv_parser_1 = __importDefault(require("./argv-parser"));
|
|
17
|
+
const debug_1 = __importDefault(require("debug"));
|
|
18
|
+
const console_logger_1 = require("@cucumber/cucumber/lib/api/console_logger");
|
|
19
|
+
const console_1 = require("console");
|
|
20
|
+
class Cli {
|
|
21
|
+
argv;
|
|
22
|
+
cwd;
|
|
23
|
+
stdout;
|
|
24
|
+
stderr;
|
|
25
|
+
env;
|
|
26
|
+
constructor({ argv, cwd, stdout, stderr, env }) {
|
|
27
|
+
this.argv = argv;
|
|
28
|
+
this.cwd = cwd;
|
|
29
|
+
this.stdout = stdout;
|
|
30
|
+
this.stderr = stderr;
|
|
31
|
+
this.env = env;
|
|
32
|
+
}
|
|
33
|
+
async run() {
|
|
34
|
+
await (0, install_validator_1.validateInstall)();
|
|
35
|
+
const { options, configuration: argvConfiguration } = argv_parser_1.default.parse(this.argv);
|
|
36
|
+
if (options.i18nLanguages) {
|
|
37
|
+
this.stdout.write((0, i18n_1.getLanguages)());
|
|
38
|
+
return {
|
|
39
|
+
shouldAdvertisePublish: false,
|
|
40
|
+
shouldExitImmediately: true,
|
|
41
|
+
success: true
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (options.i18nKeywords) {
|
|
45
|
+
this.stdout.write((0, i18n_1.getKeywords)(options.i18nKeywords));
|
|
46
|
+
return {
|
|
47
|
+
shouldAdvertisePublish: false,
|
|
48
|
+
shouldExitImmediately: true,
|
|
49
|
+
success: true
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const enableDebug = debug_1.default.enabled('cucumber');
|
|
53
|
+
const environment = {
|
|
54
|
+
cwd: this.cwd,
|
|
55
|
+
stdout: this.stdout,
|
|
56
|
+
stderr: this.stderr,
|
|
57
|
+
env: this.env,
|
|
58
|
+
debug: enableDebug
|
|
59
|
+
};
|
|
60
|
+
const consoleLogger = new console_1.Console(environment.stdout, environment.stderr);
|
|
61
|
+
consoleLogger.info('Loading configuration and step definitions...\n');
|
|
62
|
+
const { useConfiguration: configuration, runConfiguration } = await (0, load_configuration_1.loadConfiguration)({
|
|
63
|
+
file: options.config,
|
|
64
|
+
profiles: options.profile,
|
|
65
|
+
provided: argvConfiguration
|
|
66
|
+
}, environment);
|
|
67
|
+
// get run options
|
|
68
|
+
const { cwd } = (0, environment_1.mergeEnvironment)(environment);
|
|
69
|
+
const newId = messages_1.IdGenerator.uuid();
|
|
70
|
+
const runOptions = runConfiguration;
|
|
71
|
+
const supportCoordinates = 'World' in runOptions.support ? runOptions.support.originalCoordinates : runOptions.support;
|
|
72
|
+
const logger = new console_logger_1.ConsoleLogger(environment.stderr, enableDebug);
|
|
73
|
+
const { requirePaths, importPaths } = await (0, paths_1.resolvePaths)(logger, cwd, runOptions.sources, supportCoordinates);
|
|
74
|
+
// Load the step and hook definitions
|
|
75
|
+
const supportCodeLibrary = 'World' in runOptions.support
|
|
76
|
+
? runOptions.support
|
|
77
|
+
: await (0, support_1.getSupportCodeLibrary)({
|
|
78
|
+
cwd,
|
|
79
|
+
newId,
|
|
80
|
+
requirePaths,
|
|
81
|
+
importPaths,
|
|
82
|
+
requireModules: supportCoordinates.requireModules
|
|
83
|
+
});
|
|
84
|
+
// Set support to the updated step and hook definitions
|
|
85
|
+
// in the supportCodeLibrary. We also need to initialize originalCoordinates
|
|
86
|
+
// to support parallel execution.
|
|
87
|
+
runOptions.support = binding_registry_1.BindingRegistry.instance.updateSupportCodeLibrary(supportCodeLibrary);
|
|
88
|
+
runOptions.support = { ...runOptions.support, ...{ originalCoordinates: supportCoordinates } };
|
|
89
|
+
// now we can run cucumber
|
|
90
|
+
const { success } = await (0, run_cucumber_1.runCucumber)(runOptions, environment);
|
|
91
|
+
return {
|
|
92
|
+
shouldAdvertisePublish: !runConfiguration.formats.publish &&
|
|
93
|
+
!configuration.publishQuiet &&
|
|
94
|
+
!(0, index_1.isTruthyString)(this.env.CUCUMBER_PUBLISH_QUIET),
|
|
95
|
+
shouldExitImmediately: configuration.forceExit,
|
|
96
|
+
success
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.default = Cli;
|
|
101
101
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsaURBQWlEO0FBQ2pELHNFQUE0RTtBQUc1RSwyREFBdUQ7QUFDdkQsNkRBQXlEO0FBQ3pELDBEQUE0RTtBQUM1RSxvRkFBK0U7QUFDL0UsNERBQWdFO0FBQ2hFLHdFQUEwRTtBQUMxRSxnRUFBMkU7QUFDM0UsbUVBQStEO0FBQy9ELGdFQUF1QztBQUN2QyxrREFBMEI7QUFFMUIsOEVBQTBFO0FBQzFFLHFDQUFrQztBQVFsQyxNQUFxQixHQUFHO0lBQ04sSUFBSSxDQUFXO0lBQ2YsR0FBRyxDQUFTO0lBQ1osTUFBTSxDQUFtQjtJQUN6Qix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sV0FBVyxDQUFDLENBQUM7UUFDL0QsT0FBTztZQUNOLHNCQUFzQixFQUNyQixDQUFDLGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxPQUFPO2dCQUNqQyxDQUFDLGFBQWEsQ0FBQyxZQUFZO2dCQUMzQixDQUFDLElBQUEsc0JBQWMsRUFBQyxJQUFJLENBQUMsR0FBRyxDQUFDLHNCQUFzQixDQUFDO1lBQ2pELHFCQUFxQixFQUFFLGFBQWEsQ0FBQyxTQUFTO1lBQzlDLE9BQU87U0FDUCxDQUFDO0lBQ0gsQ0FBQztDQUNEO0FBMUdELHNCQTBHQyJ9
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { IRunEnvironment, ILoadConfigurationOptions, IRunConfiguration } from '@cucumber/cucumber/lib/api/types';
|
|
2
|
-
import { ITsflowConfiguration } from './argv-parser';
|
|
3
|
-
export interface ITsflowResolvedConfiguration {
|
|
4
|
-
/**
|
|
5
|
-
* The final flat configuration object resolved from the configuration file/profiles plus any extra provided.
|
|
6
|
-
*/
|
|
7
|
-
useConfiguration: ITsflowConfiguration;
|
|
8
|
-
/**
|
|
9
|
-
* The format that can be passed into `runCucumber`.
|
|
10
|
-
*/
|
|
11
|
-
runConfiguration: IRunConfiguration;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Load user-authored configuration to be used in a test run.
|
|
15
|
-
*
|
|
16
|
-
* @public
|
|
17
|
-
* @param options - Coordinates required to find configuration.
|
|
18
|
-
* @param environment - Project environment.
|
|
19
|
-
*/
|
|
20
|
-
export declare const loadConfiguration: (options?: ILoadConfigurationOptions, environment?: IRunEnvironment) => Promise<ITsflowResolvedConfiguration>;
|
|
1
|
+
import { IRunEnvironment, ILoadConfigurationOptions, IRunConfiguration } from '@cucumber/cucumber/lib/api/types';
|
|
2
|
+
import { ITsflowConfiguration } from './argv-parser';
|
|
3
|
+
export interface ITsflowResolvedConfiguration {
|
|
4
|
+
/**
|
|
5
|
+
* The final flat configuration object resolved from the configuration file/profiles plus any extra provided.
|
|
6
|
+
*/
|
|
7
|
+
useConfiguration: ITsflowConfiguration;
|
|
8
|
+
/**
|
|
9
|
+
* The format that can be passed into `runCucumber`.
|
|
10
|
+
*/
|
|
11
|
+
runConfiguration: IRunConfiguration;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Load user-authored configuration to be used in a test run.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @param options - Coordinates required to find configuration.
|
|
18
|
+
* @param environment - Project environment.
|
|
19
|
+
*/
|
|
20
|
+
export declare const loadConfiguration: (options?: ILoadConfigurationOptions, environment?: IRunEnvironment) => Promise<ITsflowResolvedConfiguration>;
|