Skip to content

Commit 7f32776

Browse files
committed
test for valid non-json response
1 parent 34a9a7b commit 7f32776

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ app.get("/invalid_json", (req, res) => {
3232
res.send("invalid");
3333
});
3434

35+
app.get("non_object", (req, res) => {
36+
res.send("1");
37+
});
38+
3539
app.get("/no_next_page", (req, res) => {
3640
res.send(
3741
JSON.stringify({

tests/test.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ describe("Network and API issues", () => {
392392
await testOptions({catchPage: "invalid_json"});
393393
});
394394

395+
testWrapper("Non object", async () => {
396+
await testOptions({catchPage: "non_object"});
397+
});
398+
395399
testWrapper("No next page", async () => {
396400
await testOptions({catchPage: "no_next_page", pageQuery: "data"});
397401
});

0 commit comments

Comments
 (0)