chore(bruno): update Bruno test files with minor formatting improvements

This commit is contained in:
2026-01-29 11:03:14 -05:00
parent 66f1eb11a0
commit 0276e3312c
4 changed files with 22 additions and 142 deletions
+2 -47
View File
@@ -6,6 +6,7 @@ meta {
get {
url: {{base_url}}/api/libraries
body: none
auth: inherit
}
@@ -13,52 +14,6 @@ headers {
Content-Type: application/json
}
tests {
test_get_libraries_success(status, headers, body) {
if (status !== 200) {
throw new Error("Expected status 200, got " + status);
}
const contentType = headers["content-type"];
if (!contentType || !contentType.includes("application/json")) {
throw new Error("Expected content-type to contain application/json, got " + contentType);
}
// Verify response body is valid JSON and has expected structure
let data;
try {
data = JSON.parse(body);
} catch (e) {
throw new Error("Response body is not valid JSON");
}
if (!Array.isArray(data)) {
throw new Error("Expected response body to be an array");
}
// Validate each library in array
data.forEach((library, index) => {
if (!library || typeof library !== "object") {
throw new Error("Library at index " + index + " is not an object");
}
if (!library.id) {
throw new Error("Library at index " + index + " missing required field: id");
}
if (!library.name) {
throw new Error("Library at index " + index + " missing required field: name");
}
if (!library.type) {
throw new Error("Library at index " + index + " missing required field: type");
}
});
return true;
}
}
settings {
encodeUrl: true
timeout: 0
@@ -91,4 +46,4 @@ docs {
- 401: Unauthorized
- 403: Forbidden (admin access required)
- 500: Internal server error
}
}