As all Postman collections are basically .json files it's quite difficult to review code written in Postman via code review tools.
At the moment I continue to review such .json files on GitHub, however, it's not quite convenient.
For instance, here's some JS code sent for review in .json format
"listen": "test",
"script": {
"id": "e8f64f04-8ca5-4b5a-8333-1f6bde73cf0c",
"exec": [
"var body = xml2Json(responseBody);",
"// const resp = pm.response.json();",
"let resp = body.projects;",
"var b = \"New_Poject_e2e\"+pm.environment.get(\"random_number\");",
" console.log(b);",
"for (var i = 0; i < resp.project.length; i++)",
"{",
" if (resp.project[i].name === b)",
" {",
" console.log(resp.project[i].id[\"_\"]);",
" pm.environment.set(\"projID\", resp.project[i].id[\"_\"]);",
" }",
"}",
""
],
"type": "text/javascript"
}
Is there an effective way to carry out code review for Pre-request scripts, Requests, and Tests for Postman Collections?
Have you tried creating a fork of the Collection?
https://learning.getpostman.com/docs/postman/collections/version_control/#forking-a-collection
You can make changes in the Forked Collection and then Merge them - Before merging you get taken to the web view which might make these diffs easier.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With