A chainable, thenable query-builder stub that resolves to the given rows.
(rows: unknown[])
| 66 | |
| 67 | /** A chainable, thenable query-builder stub that resolves to the given rows. */ |
| 68 | function builder(rows: unknown[]) { |
| 69 | const b: Record<string, unknown> = {} |
| 70 | for (const method of ['from', 'leftJoin', 'innerJoin', 'where', 'orderBy', 'limit']) { |
| 71 | b[method] = () => b |
| 72 | } |
| 73 | ;(b as { then: unknown }).then = (resolve: (value: unknown) => unknown) => resolve(rows) |
| 74 | return b |
| 75 | } |
| 76 | |
| 77 | function workflowRow(overrides: Record<string, unknown> = {}) { |
| 78 | return { |
no test coverage detected