(steps: {
setup: () => Promise<void>
test: () => Promise<void>
finish: () => Promise<void>
keep?: boolean
})
| 1 | export async function executeSteps(steps: { |
| 2 | setup: () => Promise<void> |
| 3 | test: () => Promise<void> |
| 4 | finish: () => Promise<void> |
| 5 | keep?: boolean |
| 6 | }) { |
| 7 | try { |
| 8 | await steps.setup() |
| 9 | await steps.test() |
| 10 | } finally { |
| 11 | await steps.finish() |
| 12 | |
| 13 | while (steps.keep === true) { |
| 14 | await new Promise((res) => { |
| 15 | setTimeout(res, 10_000) |
| 16 | }) |
| 17 | } |
| 18 | } |
| 19 | } |
no test coverage detected