( allQuery: (container: HTMLElement, ...args: Arguments) => HTMLElement[], getMissingError: GetErrorFunction<Arguments>, )
| 99 | // this accepts a query function and returns a function which throws an error |
| 100 | // if an empty list of elements is returned |
| 101 | function makeGetAllQuery<Arguments extends unknown[]>( |
| 102 | allQuery: (container: HTMLElement, ...args: Arguments) => HTMLElement[], |
| 103 | getMissingError: GetErrorFunction<Arguments>, |
| 104 | ) { |
| 105 | return (container: HTMLElement, ...args: Arguments) => { |
| 106 | const els = allQuery(container, ...args) |
| 107 | if (!els.length) { |
| 108 | throw getConfig().getElementError( |
| 109 | getMissingError(container, ...args), |
| 110 | container, |
| 111 | ) |
| 112 | } |
| 113 | |
| 114 | return els |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | // this accepts a getter query function and returns a function which calls |
| 119 | // waitFor and passing a function which invokes the getter. |
no test coverage detected