Skip to content

Commit 73e34f7

Browse files
committed
docs: add Expect documentation and inline API links
- Add dedicated Expect API documentation page (docs/expect.md) - Add inline API links with fragments to all doc pages: - Overview: client namespace and factory function links - Scenario: scenario() and Skip class links - Client: section headers and factory function links - Configuration: client configuration section links - Register Expect page in docs.ts navigation (after Client) - Update Next Steps sections with Expect page link
1 parent d552b2f commit 73e34f7

6 files changed

Lines changed: 387 additions & 63 deletions

File tree

data/docs.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ export const docPages: DocPage[] = [
4040
description:
4141
"Client API reference for HTTP, SQL, gRPC, GraphQL, Redis, MongoDB, and more",
4242
},
43+
{
44+
path: "/docs/expect/",
45+
file: "./docs/expect.md",
46+
title: "Expect",
47+
label: "Expect",
48+
description:
49+
"Type-safe assertion API for HTTP, SQL, Redis, MongoDB, and other client responses",
50+
},
4351
{
4452
path: "/docs/configuration/",
4553
file: "./docs/configuration.md",

docs/client.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ await using http = client.http.createHttpClient({
6666
// Automatically closed when scope exits
6767
```
6868

69-
## HTTP Client
69+
## [HTTP Client](/api/client-http/#createHttpClient)
7070

7171
The HTTP client provides a fluent API for making HTTP requests with built-in
7272
JSON handling and response assertions.
@@ -159,12 +159,12 @@ expect(res).toHaveDataPresent(); // Check if response has data
159159

160160
Probitas supports multiple SQL databases with a consistent query interface.
161161

162-
| Database | Client Factory |
163-
| ---------- | -------------------------------------------- |
164-
| PostgreSQL | `client.sql.postgres.createPostgresClient()` |
165-
| MySQL | `client.sql.mysql.createMySqlClient()` |
166-
| SQLite | `client.sql.sqlite.createSqliteClient()` |
167-
| DuckDB | `client.sql.duckdb.createDuckDbClient()` |
162+
| Database | Client Factory |
163+
| ---------- | ---------------------------------------------------------------------------------------------- |
164+
| PostgreSQL | [`client.sql.postgres.createPostgresClient()`](/api/client-sql-postgres/#createPostgresClient) |
165+
| MySQL | [`client.sql.mysql.createMySqlClient()`](/api/client-sql-mysql/#createMySqlClient) |
166+
| SQLite | [`client.sql.sqlite.createSqliteClient()`](/api/client-sql-sqlite/#createSqliteClient) |
167+
| DuckDB | [`client.sql.duckdb.createDuckDbClient()`](/api/client-sql-duckdb/#createDuckDbClient) |
168168

169169
```typescript
170170
import { client } from "jsr:@probitas/probitas";
@@ -266,7 +266,7 @@ expect(result).toHaveRowCountGreaterThan(0); // More than 0 rows
266266
expect(result).toHaveRowCountLessThanOrEqual(10); // At most 10 rows
267267
```
268268

269-
## gRPC Client
269+
## [gRPC Client](/api/client-grpc/#createGrpcClient)
270270

271271
The gRPC client supports unary calls, server streaming, client streaming, and
272272
bidirectional streaming.
@@ -364,7 +364,7 @@ for await (
364364
}
365365
```
366366

367-
## ConnectRPC Client
367+
## [ConnectRPC Client](/api/client-connectrpc/#createConnectRpcClient)
368368

369369
The ConnectRPC client supports Connect, gRPC, and gRPC-Web protocols with a
370370
unified API.
@@ -412,7 +412,7 @@ for await (
412412
}
413413
```
414414

415-
## GraphQL Client
415+
## [GraphQL Client](/api/client-graphql/#createGraphqlClient)
416416

417417
The GraphQL client provides methods for queries, mutations, and subscriptions.
418418

@@ -533,7 +533,7 @@ expect(res).toHaveExtensionsProperty("tracing"); // Has tracing extension
533533
expect(res).toHaveExtensionsPropertyContaining("tracing", { version: 1 }); // Extension with value
534534
```
535535

536-
## Redis Client
536+
## [Redis Client](/api/client-redis/#createRedisClient)
537537

538538
The Redis client provides operations for strings, hashes, lists, and sets.
539539

@@ -587,7 +587,7 @@ expect(result).toHaveValueContaining("substring"); // Value contains substring
587587
// expect(result).toHaveValueCount(5); // String length or collection size
588588
```
589589

590-
## MongoDB Client
590+
## [MongoDB Client](/api/client-mongodb/#createMongoClient)
591591

592592
The MongoDB client provides document operations with a familiar API.
593593

@@ -653,7 +653,7 @@ expect(allUsersResult).toHaveDocsMatching([{ name: "Alice" }]); // Match multipl
653653
expect(deleteResult).toHaveDeletedCount(1); // 1 document deleted
654654
```
655655

656-
## Deno KV Client
656+
## [Deno KV Client](/api/client-deno-kv/#createDenoKvClient)
657657

658658
The Deno KV client provides access to Deno's built-in key-value store.
659659

@@ -694,7 +694,7 @@ const commitResult = await atomic.commit();
694694
await kv.delete(["users", "1"]);
695695
```
696696

697-
## RabbitMQ Client
697+
## [RabbitMQ Client](/api/client-rabbitmq/#createRabbitMqClient)
698698

699699
The RabbitMQ client provides AMQP messaging for publish/subscribe patterns.
700700

@@ -736,7 +736,7 @@ if (result.message) {
736736
await channel.close();
737737
```
738738

739-
## SQS Client
739+
## [SQS Client](/api/client-sqs/#createSqsClient)
740740

741741
The AWS SQS client provides cloud message queue operations.
742742

@@ -783,21 +783,21 @@ for (const msg of receiveResult.messages) {
783783

784784
## Available Clients
785785

786-
| Client | Factory Function | Use Case |
787-
| ---------- | -------------------------------------------- | -------------------- |
788-
| HTTP | `client.http.createHttpClient()` | REST APIs, webhooks |
789-
| PostgreSQL | `client.sql.postgres.createPostgresClient()` | PostgreSQL databases |
790-
| MySQL | `client.sql.mysql.createMySqlClient()` | MySQL databases |
791-
| SQLite | `client.sql.sqlite.createSqliteClient()` | Embedded databases |
792-
| DuckDB | `client.sql.duckdb.createDuckDbClient()` | Analytics databases |
793-
| gRPC | `client.grpc.createGrpcClient()` | gRPC services |
794-
| ConnectRPC | `client.connectrpc.createConnectRpcClient()` | Connect/gRPC-Web |
795-
| GraphQL | `client.graphql.createGraphqlClient()` | GraphQL APIs |
796-
| Redis | `client.redis.createRedisClient()` | Cache, pub/sub |
797-
| MongoDB | `client.mongodb.createMongoClient()` | Document databases |
798-
| Deno KV | `client.deno_kv.createDenoKvClient()` | Deno KV store |
799-
| RabbitMQ | `client.rabbitmq.createRabbitMqClient()` | AMQP message queues |
800-
| SQS | `client.sqs.createSqsClient()` | AWS message queues |
786+
| Client | Factory Function | Use Case |
787+
| ---------- | ---------------------------------------------------------------------------------------------- | -------------------- |
788+
| HTTP | [`client.http.createHttpClient()`](/api/client-http/#createHttpClient) | REST APIs, webhooks |
789+
| PostgreSQL | [`client.sql.postgres.createPostgresClient()`](/api/client-sql-postgres/#createPostgresClient) | PostgreSQL databases |
790+
| MySQL | [`client.sql.mysql.createMySqlClient()`](/api/client-sql-mysql/#createMySqlClient) | MySQL databases |
791+
| SQLite | [`client.sql.sqlite.createSqliteClient()`](/api/client-sql-sqlite/#createSqliteClient) | Embedded databases |
792+
| DuckDB | [`client.sql.duckdb.createDuckDbClient()`](/api/client-sql-duckdb/#createDuckDbClient) | Analytics databases |
793+
| gRPC | [`client.grpc.createGrpcClient()`](/api/client-grpc/#createGrpcClient) | gRPC services |
794+
| ConnectRPC | [`client.connectrpc.createConnectRpcClient()`](/api/client-connectrpc/#createConnectRpcClient) | Connect/gRPC-Web |
795+
| GraphQL | [`client.graphql.createGraphqlClient()`](/api/client-graphql/#createGraphqlClient) | GraphQL APIs |
796+
| Redis | [`client.redis.createRedisClient()`](/api/client-redis/#createRedisClient) | Cache, pub/sub |
797+
| MongoDB | [`client.mongodb.createMongoClient()`](/api/client-mongodb/#createMongoClient) | Document databases |
798+
| Deno KV | [`client.deno_kv.createDenoKvClient()`](/api/client-deno-kv/#createDenoKvClient) | Deno KV store |
799+
| RabbitMQ | [`client.rabbitmq.createRabbitMqClient()`](/api/client-rabbitmq/#createRabbitMqClient) | AMQP message queues |
800+
| SQS | [`client.sqs.createSqsClient()`](/api/client-sqs/#createSqsClient) | AWS message queues |
801801

802802
## Best Practices
803803

docs/configuration.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ probitas run -s tag:smoke
6565

6666
## Scenario Options
6767

68-
Configure scenarios using the options parameter of `scenario()`.
68+
Configure scenarios using the options parameter of
69+
[`scenario()`](/api/scenario/#scenario).
6970

7071
```typescript
7172
import { scenario } from "jsr:@probitas/probitas";
@@ -233,7 +234,7 @@ scenario("Retry Example")
233234

234235
## Client Configurations
235236

236-
### HTTP Client
237+
### [HTTP Client](/api/client-http/#createHttpClient)
237238

238239
```typescript
239240
import { client } from "jsr:@probitas/probitas";
@@ -254,7 +255,7 @@ client.http.createHttpClient({
254255
| `timeout` | Request timeout (ms) ||
255256
| `redirect` | `"follow"`, `"manual"`, or `"error"` | `"follow"` |
256257

257-
### PostgreSQL Client
258+
### [PostgreSQL Client](/api/client-sql-postgres/#createPostgresClient)
258259

259260
```typescript
260261
import { client } from "jsr:@probitas/probitas";
@@ -288,7 +289,7 @@ client.sql.postgres.createPostgresClient({
288289
});
289290
```
290291

291-
### gRPC Client
292+
### [gRPC Client](/api/client-grpc/#createGrpcClient)
292293

293294
```typescript
294295
import { client } from "jsr:@probitas/probitas";
@@ -307,7 +308,7 @@ client.grpc.createGrpcClient({
307308
| `tls` | TLS configuration ||
308309
| `schema` | Proto schema source | `"reflection"` |
309310

310-
### GraphQL Client
311+
### [GraphQL Client](/api/client-graphql/#createGraphqlClient)
311312

312313
```typescript
313314
import { client } from "jsr:@probitas/probitas";
@@ -325,7 +326,7 @@ client.graphql.createGraphqlClient({
325326
| `wsUrl` | WebSocket endpoint for subscriptions ||
326327
| `throwOnError` | Throw on GraphQL errors | `true` |
327328

328-
### Redis Client
329+
### [Redis Client](/api/client-redis/#createRedisClient)
329330

330331
```typescript
331332
import { client } from "jsr:@probitas/probitas";
@@ -339,7 +340,7 @@ client.redis.createRedisClient({
339340
| ------ | ---------------------------------------- | -------------------------- |
340341
| `url` | Redis connection URL (redis://host:port) | `"redis://localhost:6379"` |
341342

342-
### MongoDB Client
343+
### [MongoDB Client](/api/client-mongodb/#createMongoClient)
343344

344345
```typescript
345346
import { client } from "jsr:@probitas/probitas";
@@ -355,7 +356,7 @@ client.mongodb.createMongoClient({
355356
| `uri` | MongoDB connection URI ||
356357
| `database` | Default database name ||
357358

358-
### RabbitMQ Client
359+
### [RabbitMQ Client](/api/client-rabbitmq/#createRabbitMqClient)
359360

360361
```typescript
361362
import { client } from "jsr:@probitas/probitas";
@@ -369,7 +370,7 @@ client.rabbitmq.createRabbitMqClient({
369370
| ------ | ------------------- | -------------------- |
370371
| `url` | AMQP connection URL | `"amqp://localhost"` |
371372

372-
### SQS Client
373+
### [SQS Client](/api/client-sqs/#createSqsClient)
373374

374375
```typescript
375376
import { client } from "jsr:@probitas/probitas";

0 commit comments

Comments
 (0)