MCPcopy Index your code
hub / github.com/code-pushup/cli / setupTestRepo

Function setupTestRepo

e2e/ci-e2e/mocks/setup.ts:17–45  ·  view source on GitHub ↗
(folder: string)

Source from the content-addressed store, hash-verified

15export type TestRepo = Awaited<ReturnType<typeof setupTestRepo>>;
16
17export async function setupTestRepo(folder: string) {
18 const fixturesDir = path.join(
19 fileURLToPath(path.dirname(import.meta.url)),
20 'fixtures',
21 folder,
22 );
23 const baseDir = path.join(
24 process.cwd(),
25 E2E_ENVIRONMENTS_DIR,
26 nxTargetProject(),
27 TEST_OUTPUT_DIR,
28 folder,
29 );
30
31 await cp(fixturesDir, baseDir, { recursive: true });
32 await restoreNxIgnoredFiles(baseDir);
33
34 const git = await initGitRepo(simpleGit, { baseDir });
35 await simulateGitFetch(git);
36
37 await git.add('.');
38 await git.commit('Initial commit');
39
40 return {
41 git,
42 baseDir,
43 cleanup: () => teardownTestFolder(baseDir),
44 };
45}

Callers 3

basic.e2e.test.tsFile · 0.85

Calls 5

nxTargetProjectFunction · 0.90
restoreNxIgnoredFilesFunction · 0.90
initGitRepoFunction · 0.90
simulateGitFetchFunction · 0.90
teardownTestFolderFunction · 0.90

Tested by

no test coverage detected