* Wraps provided function (which typically contains the code of a test) into a new function that * performs the necessary setup of the environment.
( elementGetter: () => HTMLElement, html: string, blockFn: () => Promise<unknown> | void, )
| 79 | * performs the necessary setup of the environment. |
| 80 | */ |
| 81 | function wrapTestFn( |
| 82 | elementGetter: () => HTMLElement, |
| 83 | html: string, |
| 84 | blockFn: () => Promise<unknown> | void, |
| 85 | ): jasmine.ImplementationCallback { |
| 86 | return () => { |
| 87 | elementGetter().innerHTML = html; |
| 88 | return blockFn(); |
| 89 | }; |
| 90 | } |
| 91 | |
| 92 | let savedDocument: Document | undefined = undefined; |
| 93 | let savedRequestAnimationFrame: ((callback: FrameRequestCallback) => number) | undefined = |