(work)
| 61 | * all the elements (built with `createHTMLElement`) after a test. |
| 62 | */ |
| 63 | export function withElementCollector(work) { |
| 64 | let r; |
| 65 | let poolIndex = elementPool.length; |
| 66 | elementPool[poolIndex] = []; |
| 67 | try { |
| 68 | r = work(); |
| 69 | } finally { |
| 70 | drainPool(elementPool[poolIndex]); |
| 71 | elementPool = elementPool.slice( |
| 72 | 0, poolIndex |
| 73 | ); |
| 74 | } |
| 75 | return r; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Polyfill for String.includes on some node versions. |
no test coverage detected
searching dependent graphs…