()
| 262 | // `.limit`/`.orderBy`, so `select().from()[.leftJoin()].where()[.limit()]` |
| 263 | // works whether or not a terminal is chained. |
| 264 | const whereResult = () => { |
| 265 | const thenable: any = Promise.resolve([]) |
| 266 | thenable.limit = vi.fn(() => Promise.resolve([])) |
| 267 | thenable.orderBy = vi.fn(() => Promise.resolve([])) |
| 268 | return thenable |
| 269 | } |
| 270 | const fromBuilder = () => ({ |
| 271 | where: vi.fn(whereResult), |
| 272 | leftJoin: vi.fn(() => ({ where: vi.fn(whereResult) })), |