-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Question] Is there a posibility to pass Joi options that override Joi default options to .expect() method? #484
Comments
Yes. Small sample code const frisby = require('frisby');
const Joi = frisby.Joi;
const options = { convert: true };
it('Test', () => {
return frisby.fromJSON({
number: '1',
})
.expect('jsonTypes', Joi.object({
number: Joi.number(),
}).options(options));
}); const options = { convert: false }; Result
|
Did you solve this issue? |
@H1Gdev I thought there is a simpler method with passing defaults to .expect(). |
Voting this to be implemented in the next release as an optional parameter for expect(). |
I think that proposal from @terradek is better.
But if impletemt this, then need to change order of parameters. .expect('jsonTypes', path, json) to .expect('jsonTypes', json, path, options) And should also change order of I think that change of interface is very affected. Do you have any good ideas? |
I'm using this method to pass it but I wonder if it's optimal enough?:
Thank you in advance
The text was updated successfully, but these errors were encountered: