( current: CurrentScenario, fn: () => Promise<void> )
| 74 | let currentScenario: CurrentScenario | null = null |
| 75 | |
| 76 | export function withCurrent( |
| 77 | current: CurrentScenario, |
| 78 | fn: () => Promise<void> |
| 79 | ): Promise<void> { |
| 80 | const prev = currentScenario |
| 81 | currentScenario = current |
| 82 | return fn().finally(() => { |
| 83 | currentScenario = prev |
| 84 | }) |
| 85 | } |
| 86 | |
| 87 | export const PREVIOUS = Symbol('previous measurement with that unit') |
| 88 |
no test coverage detected