We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context
To Reproduce What are you trying to achieve or the steps to reproduce ? Please include any relevant Joi schemas.
When the Joi schema uses the any.when(condition,options) API, an invalid mock is returned. Example Schema
any.when(condition,options)
priceCents: Joi.number().when('.fundType', { is : FUND_TYPES.FIXED, then: Joi.number() .min(1) .max(100000) .required(), otherwise: Joi.forbidden().default(100) }),
The conditional is not respected; when running tests against a schema containing the above snippet, the following fails on validation:
const instance = felicity.entityFor(schema); const mock = entity.generateMock(); const result = instance.validate(mock);
Expected behavior The generated mock should be valid for the Joi schema passed to the Felicity API.
Observed behavior The generated mock fails validation.
Example Mock A - condition is satisfied, but the value is NaN
NaN
Example Mock B - condition is not satisfied, but the value is populated.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Context
To Reproduce
What are you trying to achieve or the steps to reproduce ?
Please include any relevant Joi schemas.
When the Joi schema uses the
any.when(condition,options)
API, an invalid mock is returned.Example Schema
The conditional is not respected; when running tests against a schema containing the above snippet, the following fails on validation:
Expected behavior
The generated mock should be valid for the Joi schema passed to the Felicity API.
Observed behavior
The generated mock fails validation.
Example Mock A - condition is satisfied, but the value is
NaN
Example Mock B - condition is not satisfied, but the value is populated.
The text was updated successfully, but these errors were encountered: