Skip to content

Commit 0e3cfba

Browse files
committed
docs: update examples for response accessor API change
Updated code examples to reflect the breaking change in probitas-client where response body accessors changed from methods to properties. Changed accessor calls: - res.json() → res.json (HTTP client) - res.data() → res.data (gRPC/GraphQL clients) This aligns with probitas-client PR #65 which converted getter methods to properties for cleaner API. The json property now returns 'unknown' requiring explicit type assertions where needed. Ref: probitas-test/probitas-client#65
1 parent c1f6cde commit 0e3cfba

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ for await (
365365
)
366366
) {
367367
expect(res).toBeOk();
368-
console.log("Received:", res.data());
368+
console.log("Received:", res.data);
369369
}
370370
```
371371

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ scenario("Retry Example")
273273
},
274274
},
275275
});
276-
return res.json();
276+
return res.json;
277277
})
278278
.build();
279279
```

docs/scenario.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default scenario("User API CRUD", {
3131
const { http } = ctx.resources;
3232
const res = await http.get("/users/test-user");
3333
expect(res).toHaveStatus(200);
34-
return res.json();
34+
return res.json;
3535
})
3636
.build();
3737
```
@@ -553,7 +553,7 @@ scenario("Retry Example")
553553
const { http } = ctx.resources;
554554
const res = await http.get("/sometimes-fails");
555555
expect(res).toBeOk();
556-
return res.json();
556+
return res.json;
557557
},
558558
{
559559
retry: { maxAttempts: 3, backoff: "exponential" },

0 commit comments

Comments
 (0)