Skip to content

Instantly share code, notes, and snippets.

@antklim
Last active August 13, 2019 03:55
Show Gist options
  • Save antklim/a8d26a5ae0909269784ac94ab9d67239 to your computer and use it in GitHub Desktop.
Save antklim/a8d26a5ae0909269784ac94ab9d67239 to your computer and use it in GitHub Desktop.
{
"info": {
"_postman_id": "12345",
"name": "WHATS-THE-TAB",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "songs",
"item": [
{
"name": "GET /songs",
"event": [
{
"listen": "test",
"script": {
"id": "bf2fdf02-8f4d-49f5-9f71-d4db1857469b",
"exec": [
"pm.test('Status code is 200', () => {",
" pm.response.to.have.status(200)",
"})",
"",
"pm.test('Response body is valid', () => {",
" const body = pm.response.json()",
" pm.expect(body).to.be.ok",
" pm.expect(body).to.be.an('object')",
" pm.expect(body).to.have.property('songsList')",
" pm.expect(body.songsList).to.be.an('array')",
"})",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/songs/nothing",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"songs",
"nothing"
]
}
},
"response": []
}
]
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment