MCPcopy Index your code
hub / github.com/riverqueue/river / RequireInserted

Function RequireInserted

rivertest/rivertest.go:105–108  ·  view source on GitHub ↗

RequireInserted is a test helper that verifies that a job of the given kind was inserted for work, failing the test if it wasn't. If found, the inserted job is returned so that further assertions can be made against it. job := RequireInserted(ctx, t, riverpgxv5.New(dbPool), &Job1Args{}, nil) This

(ctx context.Context, tb testing.TB, driver TDriver, expectedJob TArgs, opts *RequireInsertedOpts)

Source from the content-addressed store, hash-verified

103// because at that point the job to return is ambiguous. Use RequireManyInserted
104// to cover that case instead.
105func RequireInserted[TDriver riverdriver.Driver[TTx], TTx any, TArgs river.JobArgs](ctx context.Context, tb testing.TB, driver TDriver, expectedJob TArgs, opts *RequireInsertedOpts) *river.Job[TArgs] {
106 tb.Helper()
107 return requireInserted(ctx, tb, driver, expectedJob, opts)
108}
109
110func requireInserted[TDriver riverdriver.Driver[TTx], TTx any, TArgs river.JobArgs](ctx context.Context, t testingT, driver TDriver, expectedJob TArgs, opts *RequireInsertedOpts) *river.Job[TArgs] {
111 t.Helper()

Callers 1

Example_requireInsertedFunction · 0.92

Calls 2

requireInsertedFunction · 0.85
HelperMethod · 0.65

Tested by 1

Example_requireInsertedFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…