Verifies that there is at least one result in an array.
( results: Promise<T[]>, queryDescriptions: string[], )
| 492 | |
| 493 | /** Verifies that there is at least one result in an array. */ |
| 494 | async function _assertResultFound<T>( |
| 495 | results: Promise<T[]>, |
| 496 | queryDescriptions: string[], |
| 497 | ): Promise<T> { |
| 498 | const result = (await results)[0]; |
| 499 | if (result == undefined) { |
| 500 | throw Error( |
| 501 | `Failed to find element matching one of the following queries:\n` + |
| 502 | queryDescriptions.map(desc => `(${desc})`).join(',\n'), |
| 503 | ); |
| 504 | } |
| 505 | return result; |
| 506 | } |
| 507 | |
| 508 | /** Gets a list of description strings from a list of queries. */ |
| 509 | function _getDescriptionForLocatorForQueries(queries: (string | HarnessQuery<any>)[]) { |
no outgoing calls
no test coverage detected