Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/postman_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Start backend server
env:
S_PORT: 3100
MONGODB_URI: ${{secrets.MONGODB_URI}}
MONGODB_URI: mongodb://127.0.0.1:27017/foodstoragemanager_test
run: |
set -eo pipefail
npm --workspace=server run dev >/tmp/server.log 2>&1 &
Expand Down
11 changes: 8 additions & 3 deletions server/postman/backend.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,14 @@
"script": {
"type": "text/javascript",
"exec": [
"pm.test('delete returns 200', () => pm.response.to.have.status(200));",
"const json = pm.response.json();",
"pm.test('deleted item matches id', () => pm.expect(json.item._id).to.eql(pm.collectionVariables.get('itemId')));"
"const status = pm.response.code;",
"pm.test('delete returns 200 or 404 if already removed', () => pm.expect([200, 404]).to.include(status));",
"if (status === 200) {",
" const json = pm.response.json();",
" pm.test('deleted item matches id', () => pm.expect(json.item._id).to.eql(pm.collectionVariables.get('itemId')));",
"} else {",
" pm.test('already removed is acceptable', () => true);",
"}"
]
}
}
Expand Down