(
container: HTMLElement,
action: () => void,
)
| 176 | } |
| 177 | |
| 178 | async function countStyleChanges( |
| 179 | container: HTMLElement, |
| 180 | action: () => void, |
| 181 | ) { |
| 182 | const content = getViewport(container, 'queries').firstElementChild |
| 183 | assert(content) |
| 184 | const records: Array<MutationRecord> = [] |
| 185 | const observer = new MutationObserver((mutations) => { |
| 186 | records.push(...mutations) |
| 187 | }) |
| 188 | observer.observe(content, { attributeFilter: ['style'] }) |
| 189 | action() |
| 190 | await vi.advanceTimersByTimeAsync(0) |
| 191 | records.push(...observer.takeRecords()) |
| 192 | observer.disconnect() |
| 193 | return records.length |
| 194 | } |
| 195 | |
| 196 | function seedQueries() { |
| 197 | for (let index = 0; index < 1000; index++) { |
no test coverage detected