@cucumber/cucumber
Advanced tools
Comparing version 10.2.1 to 10.3.0
@@ -6,3 +6,2 @@ "use strict"; | ||
const configuration_1 = require("../configuration"); | ||
const validate_configuration_1 = require("../configuration/validate_configuration"); | ||
const convert_configuration_1 = require("./convert_configuration"); | ||
@@ -32,5 +31,5 @@ const environment_1 = require("./environment"); | ||
: {}; | ||
const original = (0, configuration_1.mergeConfigurations)(configuration_1.DEFAULT_CONFIGURATION, profileConfiguration, options.provided); | ||
const original = (0, configuration_1.mergeConfigurations)(configuration_1.DEFAULT_CONFIGURATION, profileConfiguration, (0, configuration_1.parseConfiguration)(logger, 'Provided', options.provided)); | ||
logger.debug('Resolved configuration:', original); | ||
(0, validate_configuration_1.validateConfiguration)(original, logger); | ||
(0, configuration_1.validateConfiguration)(original, logger); | ||
const runnable = await (0, convert_configuration_1.convertConfiguration)(logger, original, env); | ||
@@ -37,0 +36,0 @@ return { |
@@ -27,4 +27,12 @@ /// <reference types="node" /> | ||
* loaded from the configuration file/profiles | ||
* @example | ||
* \{ | ||
* failFast: true, | ||
* parallel: 2 | ||
* \} | ||
* @example "--fail-fast --parallel 2" | ||
* @remarks | ||
* This can also be provided as a string of argv-style arguments. | ||
*/ | ||
provided?: Partial<IConfiguration>; | ||
provided?: Partial<IConfiguration> | string; | ||
} | ||
@@ -31,0 +39,0 @@ /** |
@@ -11,8 +11,6 @@ "use strict"; | ||
const node_url_1 = require("node:url"); | ||
const string_argv_1 = __importDefault(require("string-argv")); | ||
const yaml_1 = __importDefault(require("yaml")); | ||
const read_pkg_up_1 = __importDefault(require("read-pkg-up")); | ||
const merge_configurations_1 = require("./merge_configurations"); | ||
const argv_parser_1 = __importDefault(require("./argv_parser")); | ||
const check_schema_1 = require("./check_schema"); | ||
const parse_configuration_1 = require("./parse_configuration"); | ||
async function fromFile(logger, cwd, file, profiles = []) { | ||
@@ -34,3 +32,3 @@ const definitions = await loadFile(logger, cwd, file); | ||
}); | ||
return (0, merge_configurations_1.mergeConfigurations)({}, ...profiles.map((profileKey) => extractConfiguration(logger, profileKey, definitions[profileKey]))); | ||
return (0, merge_configurations_1.mergeConfigurations)({}, ...profiles.map((profileKey) => (0, parse_configuration_1.parseConfiguration)(logger, `Profile "${profileKey}"`, definitions[profileKey]))); | ||
} | ||
@@ -90,19 +88,2 @@ exports.fromFile = fromFile; | ||
} | ||
function extractConfiguration(logger, name, definition) { | ||
if (typeof definition === 'string') { | ||
logger.debug(`Profile "${name}" value is a string; parsing as argv`); | ||
const { configuration } = argv_parser_1.default.parse([ | ||
'node', | ||
'cucumber-js', | ||
...(0, string_argv_1.default)(definition), | ||
]); | ||
return configuration; | ||
} | ||
try { | ||
return (0, check_schema_1.checkSchema)(definition); | ||
} | ||
catch (error) { | ||
throw new Error(`Requested profile "${name}" failed schema validation: ${error.errors.join(' ')}`); | ||
} | ||
} | ||
//# sourceMappingURL=from_file.js.map |
@@ -6,3 +6,5 @@ export { default as ArgvParser } from './argv_parser'; | ||
export * from './merge_configurations'; | ||
export * from './parse_configuration'; | ||
export * from './split_format_descriptor'; | ||
export * from './types'; | ||
export * from './validate_configuration'; |
@@ -27,4 +27,6 @@ "use strict"; | ||
__exportStar(require("./merge_configurations"), exports); | ||
__exportStar(require("./parse_configuration"), exports); | ||
__exportStar(require("./split_format_descriptor"), exports); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./validate_configuration"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -11,16 +11,18 @@ "use strict"; | ||
function formatError(error, filterStackTraces) { | ||
let filteredStack; | ||
if (filterStackTraces) { | ||
try { | ||
filteredStack = (0, filter_stack_trace_1.filterStackTrace)(error_stack_parser_1.default.parse(error)) | ||
.map((f) => f.source) | ||
.join('\n'); | ||
} | ||
catch { | ||
// if we weren't able to parse and filter, we'll settle for the original | ||
} | ||
let processedStackTrace; | ||
try { | ||
const parsedStack = error_stack_parser_1.default.parse(error); | ||
const filteredStack = filterStackTraces | ||
? (0, filter_stack_trace_1.filterStackTrace)(parsedStack) | ||
: parsedStack; | ||
processedStackTrace = filteredStack.map((f) => f.source).join('\n'); | ||
} | ||
catch { | ||
// if we weren't able to parse and process, we'll settle for the original | ||
} | ||
const message = (0, assertion_error_formatter_1.format)(error, { | ||
colorFns: { | ||
errorStack: (stack) => filteredStack ? `\n${filteredStack}` : stack, | ||
errorStack: (stack) => { | ||
return processedStackTrace ? `\n${processedStackTrace}` : stack; | ||
}, | ||
}, | ||
@@ -33,2 +35,3 @@ }); | ||
message: typeof error === 'string' ? error : error.message, | ||
stackTrace: processedStackTrace ?? error.stack, | ||
}, | ||
@@ -35,0 +38,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
export declare const version = "10.2.1"; | ||
export declare const version = "10.3.0"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
// Generated by genversion. | ||
exports.version = '10.2.1'; | ||
exports.version = '10.3.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "10.2.1", | ||
"version": "10.3.0", | ||
"homepage": "https://github.com/cucumber/cucumber-js", | ||
@@ -220,3 +220,3 @@ "author": "Julien Biezemans <jb@jbpros.com>", | ||
"@cucumber/messages": "24.0.1", | ||
"@cucumber/tag-expressions": "6.0.0", | ||
"@cucumber/tag-expressions": "6.1.0", | ||
"assertion-error-formatter": "^3.0.0", | ||
@@ -256,3 +256,3 @@ "capital-case": "^1.0.4", | ||
"devDependencies": { | ||
"@cucumber/compatibility-kit": "14.1.0", | ||
"@cucumber/compatibility-kit": "15.0.0", | ||
"@cucumber/query": "12.0.1", | ||
@@ -259,0 +259,0 @@ "@microsoft/api-extractor": "7.39.0", |
@@ -31,3 +31,3 @@ <h1 align="center"> | ||
```shell | ||
$ npm install @cucumber/cucumber | ||
npm install @cucumber/cucumber | ||
``` | ||
@@ -83,3 +83,3 @@ | ||
```shell | ||
$ npx cucumber-js | ||
npx cucumber-js | ||
``` | ||
@@ -86,0 +86,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
856655
362
8728
+ Added@cucumber/tag-expressions@6.1.0(transitive)
- Removed@cucumber/tag-expressions@6.0.0(transitive)