(cb: (home: string) => Promise<void>)
| 23 | } |
| 24 | |
| 25 | export async function mockHome(cb: (home: string) => Promise<void>): Promise<void> { |
| 26 | const tempHome = await mktempd('angular-cli-e2e-home-'); |
| 27 | |
| 28 | const oldHome = process.env.HOME; |
| 29 | process.env.HOME = tempHome; |
| 30 | |
| 31 | try { |
| 32 | await cb(tempHome); |
| 33 | } finally { |
| 34 | process.env.HOME = oldHome; |
| 35 | |
| 36 | await rm(tempHome, { recursive: true, force: true }); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | export function assertIsError(value: unknown): asserts value is Error & { code?: string } { |
| 41 | const isError = |
no test coverage detected