Closed daspedras1 closed 4 years ago
It only works if I do this:
function statusCodeValidation(spec) {
return spec.expect('status', 200)
}
function retrieveList(status) {
return frisby.get(<endpoint here>)
.use(statusCodeValidation)
};
@daspedras1
return function.
function statusCodeValidation(statusCode) {
// return function.
return function(spec) {
spec.expect('status', statusCode)
};
}
function retrieveList(status) {
return frisby.get(<endpoint here>)
.use(statusCodeValidation(status))
};
retrieveList(200);
Hey @H1Gdev , it worked for me.
Thanks a lot! You really helped me.
Hey @vlucas, how you doing?
I saw this issue (https://github.com/vlucas/frisby/issues/478) and I tried to do something with the
use
function.I'm trying to abstract some validations, and I created a function to validate the status code. My problem is, I wanna reuse the function with multiple status, passing them in the function call.
Something like this:
But I'm getting this:
You know how can to make this work?
Thank you so much!!!