This commit is contained in:
Simon Priet
2021-09-05 22:53:58 +02:00
commit 9e2991e668
17888 changed files with 1263126 additions and 0 deletions

55
node_modules/cucumber-expressions/src/errors.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
class CucumberExpressionError extends Error {}
class AmbiguousParameterTypeError extends CucumberExpressionError {
static forConstructor(
keyName,
keyValue,
parameterTypes,
generatedExpressions
) {
return new this(
`parameter type with ${keyName}=${keyValue} is used by several parameter types: ${parameterTypes}, ${generatedExpressions}`
)
}
static forRegExp(
parameterTypeRegexp,
expressionRegexp,
parameterTypes,
generatedExpressions
) {
return new this(
`Your Regular Expression ${expressionRegexp}
matches multiple parameter types with regexp ${parameterTypeRegexp}:
${this._parameterTypeNames(parameterTypes)}
I couldn't decide which one to use. You have two options:
1) Use a Cucumber Expression instead of a Regular Expression. Try one of these:
${this._expressions(generatedExpressions)}
2) Make one of the parameter types preferential and continue to use a Regular Expression.
`
)
}
static _parameterTypeNames(parameterTypes) {
return parameterTypes.map(p => `{${p.name}}`).join('\n ')
}
static _expressions(generatedExpressions) {
return generatedExpressions.map(e => e.source).join('\n ')
}
}
class UndefinedParameterTypeError extends CucumberExpressionError {
constructor(typeName) {
super(`Undefined parameter type {${typeName}}`)
}
}
module.exports = {
AmbiguousParameterTypeError,
UndefinedParameterTypeError,
CucumberExpressionError,
}