MCPcopy Index your code
hub / github.com/angular/angular-cli / mockHome

Function mockHome

tests/e2e/utils/utils.ts:25–38  ·  view source on GitHub ↗
(cb: (home: string) => Promise<void>)

Source from the content-addressed store, hash-verified

23}
24
25export 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
40export function assertIsError(value: unknown): asserts value is Error & { code?: string } {
41 const isError =

Callers 4

windowsTestsFunction · 0.90
completion.tsFile · 0.90

Calls 1

mktempdFunction · 0.85

Tested by

no test coverage detected