Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
fix bug not set header param
Browse files Browse the repository at this point in the history
  • Loading branch information
SrHuevo committed Mar 27, 2018
1 parent 3347bf8 commit cb48d7a
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 17 deletions.
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,6 @@ handlebars.registerHelper('isXmlMediaType', helpers.isXmlMediaType);
handlebars.registerHelper('isPdfMediaType', helpers.isPdfMediaType);
handlebars.registerHelper('isNecessaryBody', helpers.isNecessaryBody);


module.exports = {
testGen: testGen
};
2 changes: 1 addition & 1 deletion templates/request/get/get.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
method: 'GET',
headers: {
'Content-Type': '{{contentType}}'{{#if headerParameters}},
{{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}},
Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}}
}
Expand Down
2 changes: 1 addition & 1 deletion templates/request/patch/patch.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
method: 'PATCH',
headers: {
'Content-Type': '{{contentType}}'{{#if headerParameters}},
{{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}},
Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}}
},
Expand Down
2 changes: 1 addition & 1 deletion templates/request/post/post.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
method: 'POST',
headers: {
'Content-Type': '{{contentType}}'{{#if headerParameters}},
{{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}},
Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}}
},
Expand Down
2 changes: 1 addition & 1 deletion templates/request/put/put.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
method: 'PUT',
headers: {
'Content-Type': '{{contentType}}'{{#if headerParameters}},
{{#each headerParameters}}'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{#each headerParameters}}'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}{{/each}}{{/if}}{{#if headerApiKey}},
{{headerApiKey.type}}: process.env.{{headerApiKey.name}}{{/if}}{{#if headerSecurity}},
Authorization: '{{headerSecurity.type}} ' + process.env.{{headerSecurity.name}}{{/if}}
},
Expand Down
2 changes: 1 addition & 1 deletion templates/supertest/delete/delete.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions templates/supertest/get/get.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down Expand Up @@ -113,7 +113,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion templates/supertest/head/head.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions templates/supertest/options/options.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down Expand Up @@ -81,7 +81,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions templates/supertest/patch/patch.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down Expand Up @@ -147,7 +147,7 @@
{{#is contentType 'application/json'}}
.send({
{{#each bodyParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/is}}
Expand Down
4 changes: 2 additions & 2 deletions templates/supertest/post/post.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down Expand Up @@ -136,7 +136,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions templates/supertest/put/put.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down Expand Up @@ -136,7 +136,7 @@
{{#if headerParameters}}
.set({
{{#each headerParameters}}
'{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}}
'{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}}
{{/each}}
})
{{/if}}
Expand Down

0 comments on commit cb48d7a

Please sign in to comment.