feat: renamed vars:req,res as vars:pre-request,post-response

This commit is contained in:
Anoop M D 2023-02-07 05:13:14 +05:30
parent dc03b6a761
commit d2227b2b05
3 changed files with 6 additions and 6 deletions

View File

@ -65,8 +65,8 @@ const grammar = ohm.grammar(`Bru {
query = "query" dictionary
varsandassert = varsreq | varsres | assert
varsreq = "vars:req" dictionary
varsres = "vars:res" dictionary
varsreq = "vars:pre-request" dictionary
varsres = "vars:post-response" dictionary
assert = "assert" dictionary
body = "body" st* "{" nl* textblock tagend

View File

@ -149,7 +149,7 @@ ${indentString(body.xml)}
const varsLocalEnabled = _.filter(reqvars, (v) => v.enabled && v.local);
const varsLocalDisabled = _.filter(reqvars, (v) => !v.enabled && v.local);
bru += `vars:req {`;
bru += `vars:pre-request {`;
if(varsEnabled.length) {
bru += `\n${indentString(varsEnabled.map(item => `${item.name}: ${item.value}`).join('\n'))}`;
@ -175,7 +175,7 @@ ${indentString(body.xml)}
const varsLocalEnabled = _.filter(resvars, (v) => v.enabled && v.local);
const varsLocalDisabled = _.filter(resvars, (v) => !v.enabled && v.local);
bru += `vars:res {`;
bru += `vars:post-response {`;
if(varsEnabled.length) {
bru += `\n${indentString(varsEnabled.map(item => `${item.name}: ${item.value}`).join('\n'))}`;

View File

@ -67,12 +67,12 @@ body:graphql:vars {
}
}
vars:req {
vars:pre-request {
departingDate: 2020-01-01
~returningDate: 2020-01-02
}
vars:res {
vars:post-response {
token: $res.body.token
@orderNumber: $res.body.orderNumber
~petId: $res.body.id