Merge pull request #733 from survivant/bugfix/import-postman-scripts

[bugfix] Put scripts in comments in Postman import
This commit is contained in:
Anoop M D 2023-10-23 17:09:36 +05:30 committed by GitHub
commit 34ea7f0673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,13 +68,13 @@ const importPostmanV2CollectionItem = (brunoParent, item) => {
if (!brunoRequestItem.request.script) { if (!brunoRequestItem.request.script) {
brunoRequestItem.request.script = {}; brunoRequestItem.request.script = {};
} }
brunoRequestItem.request.script.req = event.script.exec[0]; brunoRequestItem.request.script.req = `/* ${event.script.exec[0]} */`;
} }
if (event.listen === 'test' && event.script && event.script.exec) { if (event.listen === 'test' && event.script && event.script.exec) {
if (!brunoRequestItem.request.tests) { if (!brunoRequestItem.request.tests) {
brunoRequestItem.request.tests = {}; brunoRequestItem.request.tests = {};
} }
brunoRequestItem.request.tests = event.script.exec[0]; brunoRequestItem.request.tests = `/* ${event.script.exec[0]} */`;
} }
}); });
} }