{"id":17305989,"url":"https://github.com/alexndrmac/postman_asserts","last_synced_at":"2026-01-28T08:39:16.092Z","repository":{"id":42237169,"uuid":"185625797","full_name":"AlexNDRmac/postman_asserts","owner":"AlexNDRmac","description":"Tiny scripts for Postman Auto tests (reusable Assertions for postman tests and json schema validation)","archived":false,"fork":false,"pushed_at":"2025-12-16T20:09:33.000Z","size":401,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-20T10:58:48.008Z","etag":null,"topics":["autotesting","json","postman","tv4"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexNDRmac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-08T14:47:19.000Z","updated_at":"2025-12-16T20:09:35.000Z","dependencies_parsed_at":"2024-12-19T19:28:05.019Z","dependency_job_id":"14ff3c82-5251-447e-8261-2361fe1c9cdb","html_url":"https://github.com/AlexNDRmac/postman_asserts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlexNDRmac/postman_asserts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNDRmac%2Fpostman_asserts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNDRmac%2Fpostman_asserts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNDRmac%2Fpostman_asserts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNDRmac%2Fpostman_asserts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexNDRmac","download_url":"https://codeload.github.com/AlexNDRmac/postman_asserts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexNDRmac%2Fpostman_asserts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28842868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autotesting","json","postman","tv4"],"created_at":"2024-10-15T11:57:14.312Z","updated_at":"2026-01-28T08:39:16.076Z","avatar_url":"https://github.com/AlexNDRmac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postman Asserts | provide a clean way to organize tests\n\n[![Build status][actions build badge]][actions build link]\n[![Repository certification][codacy badge]][codacy link]\n\nIf you want use Tests inside Postman, you must always write assertions like this:\n\n```javascript\npm.test('Response should have JSON Body', function () {\n    pm.response.to.have.jsonBody();\n});\n\n// or\ntests[\"Response Data is Valid\"] = tv4.validate(pm.response.json(), schema);\n```\n\nIt will be better if we can use `Reusable functions` inside Postman. It's more flexible...\n\n## Writing tests within Postman Reusable functions\n\nTo have Assertions inside your Collection, you need to do next steps:\n\n- Save content of `pm_asserts.min.js` script as a global variable\n- In the Postman `Test scripts` - eval `postman_asserts` global variable\n- Call Asserts functions by functions' name\n\n### Setting up Assertions Script to Postman Globals\n\nTo set up Assertions - just download [Collection](./PostmanAssertsInit.postman_collection.json) and make API call with it. This Request will get Script content and set up Global variable into Postman Environment.\n\n### Using Assertions inside Postman Tests\n\nInto `Tests` window call Assertions after `eval()` Postman Globals variable, which contains Script body.\n\n```javascript\neval(globals.postman_asserts);\n\nconst schema = {\n    \"type\": \"object\",\n    \"required\": ['args', 'headers']\n};\n\nisJsonResponse();\nisResponseStatus(200);\nvalidateJsonSchema(schema);\n```\n\n## License\n\nThis project is open source software licensed under the GNU General Public License version 3.\n\n[actions build badge]: https://github.com/AlexNDRmac/postman_asserts/workflows/Postman%20Tests/badge.svg \"Build status\"\n[actions build link]: https://github.com/AlexNDRmac/postman_asserts/actions\n[codacy badge]: https://api.codacy.com/project/badge/Grade/5cb97130b06542b08ce4a370e9f10679 \"Repository certification\"\n[codacy link]: https://www.codacy.com/manual/AlexNDRmac/postman_asserts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexndrmac%2Fpostman_asserts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexndrmac%2Fpostman_asserts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexndrmac%2Fpostman_asserts/lists"}