MCPcopy Create free account
hub / github.com/cameri/nostream / makePendingClient

Function makePendingClient

test/unit/repositories/invoice-repository.spec.ts:129–136  ·  view source on GitHub ↗
(results: any[])

Source from the content-addressed store, hash-verified

127
128 describe('.findPendingInvoices', () => {
129 function makePendingClient(results: any[]): DatabaseClient {
130 const selectStub = sandbox.stub().resolves(results)
131 const limitStub = sandbox.stub().returns({ select: selectStub })
132 const offsetStub = sandbox.stub().returns({ limit: limitStub })
133 const orderByStub = sandbox.stub().returns({ offset: offsetStub })
134 const whereStub = sandbox.stub().returns({ orderBy: orderByStub })
135 return sandbox.stub().returns({ where: whereStub }) as unknown as DatabaseClient
136 }
137
138 it('returns empty array when no pending invoices exist', async () => {
139 const result = await repository.findPendingInvoices(0, 10, makePendingClient([]))

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected