@cucumber/cucumber
Advanced tools
Comparing version 10.4.0 to 10.5.0
@@ -84,3 +84,3 @@ "use strict"; | ||
default: | ||
throw new Error('Unrecgonized order type. Should be `defined` or `random`'); | ||
throw new Error('Unrecognized order type. Should be `defined` or `random`'); | ||
} | ||
@@ -87,0 +87,0 @@ } |
@@ -16,4 +16,11 @@ "use strict"; | ||
async function fromFile(logger, cwd, file, profiles = []) { | ||
const definitions = await loadFile(logger, cwd, file); | ||
if (!definitions.default) { | ||
let definitions = await loadFile(logger, cwd, file); | ||
const defaultDefinition = definitions.default; | ||
if (defaultDefinition) { | ||
if (typeof defaultDefinition === 'function') { | ||
logger.debug('Default function found; loading profiles'); | ||
definitions = await handleDefaultFunctionDefinition(definitions, defaultDefinition); | ||
} | ||
} | ||
else { | ||
logger.debug('No default profile defined in configuration file'); | ||
@@ -35,2 +42,12 @@ definitions.default = {}; | ||
exports.fromFile = fromFile; | ||
async function handleDefaultFunctionDefinition(definitions, defaultDefinition) { | ||
if (Object.keys(definitions).length > 1) { | ||
throw new Error('Invalid profiles specified: if a default function definition is provided, no other static profiles should be specified'); | ||
} | ||
const definitionsFromDefault = await defaultDefinition(); | ||
return { | ||
default: {}, | ||
...definitionsFromDefault, | ||
}; | ||
} | ||
async function loadFile(logger, cwd, file) { | ||
@@ -37,0 +54,0 @@ const filePath = node_path_1.default.join(cwd, file); |
@@ -34,8 +34,8 @@ "use strict"; | ||
buildFormattersDocumentationString() { | ||
let concatanatedFormattersDocumentation = ''; | ||
let concatenatedFormattersDocumentation = ''; | ||
const formatters = this.getFormatters(); | ||
for (const formatterName in formatters) { | ||
concatanatedFormattersDocumentation += ` ${formatterName}: ${formatters[formatterName].documentation}\n`; | ||
concatenatedFormattersDocumentation += ` ${formatterName}: ${formatters[formatterName].documentation}\n`; | ||
} | ||
return concatanatedFormattersDocumentation; | ||
return concatenatedFormattersDocumentation; | ||
}, | ||
@@ -42,0 +42,0 @@ }; |
@@ -23,7 +23,7 @@ "use strict"; | ||
if ((0, value_checker_1.doesHaveValue)(step.argument)) { | ||
const argumentParamater = (0, step_arguments_1.parseStepArgument)(step.argument, { | ||
const argumentParameter = (0, step_arguments_1.parseStepArgument)(step.argument, { | ||
dataTable: (arg) => new data_table_1.default(arg), | ||
docString: (arg) => arg.content, | ||
}); | ||
parameters.push(argumentParamater); | ||
parameters.push(argumentParameter); | ||
} | ||
@@ -30,0 +30,0 @@ return { |
@@ -22,7 +22,7 @@ "use strict"; | ||
async getInvocationParameters({ hookParameter, }) { | ||
return await Promise.resolve({ | ||
return { | ||
getInvalidCodeLengthMessage: () => this.buildInvalidCodeLengthMessage('0 or 1', '2'), | ||
parameters: [hookParameter], | ||
validCodeLengths: [0, 1, 2], | ||
}); | ||
}; | ||
} | ||
@@ -29,0 +29,0 @@ } |
@@ -20,7 +20,7 @@ "use strict"; | ||
async getInvocationParameters({ hookParameter, }) { | ||
return await Promise.resolve({ | ||
return { | ||
getInvalidCodeLengthMessage: () => this.buildInvalidCodeLengthMessage('0 or 1', '2'), | ||
parameters: [hookParameter], | ||
validCodeLengths: [0, 1, 2], | ||
}); | ||
}; | ||
} | ||
@@ -27,0 +27,0 @@ } |
@@ -37,3 +37,3 @@ /// <reference types="node" /> | ||
private success; | ||
private runTestRunHooks; | ||
private readonly runTestRunHooks; | ||
constructor({ eventBroadcaster, eventDataCollector, newId, options, pickleIds, supportCodeLibrary, }: INewRuntimeOptions); | ||
@@ -40,0 +40,0 @@ runTestCase(pickleId: string, testCase: messages.TestCase): Promise<void>; |
@@ -51,4 +51,4 @@ /// <reference types="node" /> | ||
private assembledTestCases; | ||
private inProgressPickles; | ||
private workers; | ||
private readonly inProgressPickles; | ||
private readonly workers; | ||
private readonly supportCodeLibrary; | ||
@@ -55,0 +55,0 @@ private readonly requireModules; |
@@ -74,3 +74,2 @@ "use strict"; | ||
else if ((0, value_checker_1.doesHaveValue)(error)) { | ||
details = (0, format_error_1.formatError)(error, filterStackTraces); | ||
status = messages.TestStepResultStatus.FAILED; | ||
@@ -81,2 +80,5 @@ } | ||
} | ||
if ((0, value_checker_1.doesHaveValue)(error)) { | ||
details = (0, format_error_1.formatError)(error, filterStackTraces); | ||
} | ||
return { | ||
@@ -83,0 +85,0 @@ duration, |
@@ -46,3 +46,3 @@ /// <reference types="node" /> | ||
getWorstStepResult(): messages.TestStepResult; | ||
invokeStep(step: messages.PickleStep, stepDefinition: IDefinition, hookParameter?: any): Promise<messages.TestStepResult>; | ||
invokeStep(step: messages.PickleStep, stepDefinition: IDefinition, hookParameter?: ITestCaseHookParameter): Promise<messages.TestStepResult>; | ||
isSkippingSteps(): boolean; | ||
@@ -49,0 +49,0 @@ shouldSkipHook(isBeforeHook: boolean): boolean; |
@@ -11,3 +11,3 @@ import { IdGenerator } from '@cucumber/messages'; | ||
interface IStepDefinitionConfig { | ||
code: any; | ||
code: Function; | ||
line: number; | ||
@@ -26,3 +26,3 @@ options: any; | ||
interface ITestStepHookDefinitionConfig { | ||
code: any; | ||
code: Function; | ||
line: number; | ||
@@ -33,3 +33,3 @@ options: any; | ||
interface ITestRunHookDefinitionConfig { | ||
code: any; | ||
code: Function; | ||
line: number; | ||
@@ -36,0 +36,0 @@ options: any; |
@@ -1,1 +0,1 @@ | ||
export declare const version = "10.4.0"; | ||
export declare const version = "10.5.0"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
// Generated by genversion. | ||
exports.version = '10.4.0'; | ||
exports.version = '10.5.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "10.4.0", | ||
"version": "10.5.0", | ||
"funding": "https://opencollective.com/cucumber", | ||
@@ -21,2 +21,3 @@ "homepage": "https://github.com/cucumber/cucumber-js", | ||
"Ádám Gólya <adam.golya@lab.coop>", | ||
"Ahmed Ashour (https://github.com/asashour)", | ||
"ahulab <alexbaluha@gmail.com>", | ||
@@ -119,2 +120,3 @@ "Alon Diamant <diamant.alon@gmail.com>", | ||
"Mark Amery <markamery@btinternet.com>", | ||
"Mark Stein (https://github.com/markstein)", | ||
"Martin Delille <martin@phonations.com>", | ||
@@ -136,2 +138,3 @@ "Máté Karácsony <k_mate@inf.elte.hu>", | ||
"Noah Davis <noahd1@yahoo.com>", | ||
"notaphplover (https://github.com/notaphplover)", | ||
"Oliver Odo (https://github.com/olivierodo)", | ||
@@ -298,3 +301,3 @@ "Oliver Rogers <oli.rogers@gmail.com>", | ||
"eslint-plugin-unicorn": "^48.0.1", | ||
"express": "4.18.2", | ||
"express": "4.19.2", | ||
"fs-extra": "10.1.0", | ||
@@ -301,0 +304,0 @@ "genversion": "3.1.1", |
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
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
861486
8775