()
| 3955 | |
| 3956 | describe(`single-group aggregate: count issues per project (as toArray)`, () => { |
| 3957 | function buildAggregateToArrayQuery() { |
| 3958 | return createLiveQueryCollection((q) => |
| 3959 | q.from({ p: projects }).select(({ p }) => ({ |
| 3960 | id: p.id, |
| 3961 | name: p.name, |
| 3962 | issueCount: toArray( |
| 3963 | q |
| 3964 | .from({ i: issues }) |
| 3965 | .where(({ i }) => eq(i.projectId, p.id)) |
| 3966 | .select(({ i }) => ({ total: count(i.id) })), |
| 3967 | ), |
| 3968 | })), |
| 3969 | ) |
| 3970 | } |
| 3971 | |
| 3972 | it(`each project gets its own aggregate result as an array`, async () => { |
| 3973 | const collection = buildAggregateToArrayQuery() |
no test coverage detected
searching dependent graphs…