(tx: { execute: ReturnType<typeof vi.fn> }, substring: string)
| 208 | |
| 209 | /** True when any tx.execute call ran a sql`` template containing the substring. */ |
| 210 | const executedSqlContaining = (tx: { execute: ReturnType<typeof vi.fn> }, substring: string) => |
| 211 | tx.execute.mock.calls.some(([arg]) => { |
| 212 | const strings = (arg as { strings?: readonly string[] } | null)?.strings |
| 213 | return Array.isArray(strings) && strings.some((s) => s.includes(substring)) |
| 214 | }) |
| 215 | |
| 216 | it('inserts the full cumulative on the first flush', async () => { |
| 217 | setupTx(null) |