(directory: string, cb: () => Promise<T>)
| 2 | import { Instance } from "../project/instance" |
| 3 | |
| 4 | export async function bootstrap<T>(directory: string, cb: () => Promise<T>) { |
| 5 | return Instance.provide({ |
| 6 | directory, |
| 7 | init: InstanceBootstrap, |
| 8 | fn: async () => { |
| 9 | try { |
| 10 | const result = await cb() |
| 11 | return result |
| 12 | } finally { |
| 13 | await Instance.dispose() |
| 14 | } |
| 15 | }, |
| 16 | }) |
| 17 | } |
no test coverage detected