(t *testing.T)
| 1272 | } |
| 1273 | |
| 1274 | func TestWorkContext(t *testing.T) { |
| 1275 | t.Parallel() |
| 1276 | |
| 1277 | ctx := context.Background() |
| 1278 | |
| 1279 | type testBundle struct{} |
| 1280 | |
| 1281 | setup := func(ctx context.Context, t *testing.T) (context.Context, *testBundle) { |
| 1282 | t.Helper() |
| 1283 | |
| 1284 | client, err := river.NewClient(riverpgxv5.New(nil), &river.Config{}) |
| 1285 | require.NoError(t, err) |
| 1286 | |
| 1287 | return WorkContext(ctx, client), &testBundle{} |
| 1288 | } |
| 1289 | |
| 1290 | t.Run("ClientFromContext", func(t *testing.T) { |
| 1291 | t.Parallel() |
| 1292 | |
| 1293 | ctx, _ := setup(ctx, t) |
| 1294 | |
| 1295 | client := river.ClientFromContext[pgx.Tx](ctx) |
| 1296 | require.NotNil(t, client) |
| 1297 | }) |
| 1298 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…