Closed wine-fall closed 1 year ago
By the way, to be honest, there are lots of types of pactum
is so confusing. eg:
withHeaders(headers: object): Spec;
something like this may be better:
withHeaders<T>(headers: T): Spec;
You can create a different issue to track the type definition changes.
hi @ASaiAnudeep:
thanks for merging my code! I just update the doc and types of stores, please check.
As for the optimization of other types, I think translating the whole things to typescript is a better choice. And if you'd like to do it in future, I'm happy to join it.
Anyway, I will update some types of pactumjs when I using it and create another issue to track it.
Is your feature request related to a problem? Please describe. I just feel the using of
spec().stores()
is too black box for me because the args passed to it are allstring
type and I don't know how does it work.Describe the solution you'd like May be a
stores()
with custom function passed is better. eg:Describe alternatives you've considered I read the doc and find there is a solution which is
pactum.handler.addCaptureHandler
. However, I just think it's not convenient and I have to usestores()
and pass two string to it too.Additional context I just create a pr and if you guys agree it to be merged, I'm going to add some words to the doc.