MCPcopy
hub / github.com/jesseduffield/lazygit / createFixture

Function createFixture

pkg/integration/components/runner.go:153–167  ·  view source on GitHub ↗

Sets up the fixture for test and returns the working directory to invoke lazygit in.

(test *IntegrationTest, paths Paths, rootDir string)

Source from the content-addressed store, hash-verified

151// Sets up the fixture for test and returns the working directory to invoke
152// lazygit in.
153func createFixture(test *IntegrationTest, paths Paths, rootDir string) string {
154 env := NewTestEnvironment(rootDir)
155
156 env = append(env, fmt.Sprintf("%s=%s", PWD, paths.ActualRepo()))
157 shell := NewShell(
158 paths.ActualRepo(),
159 env,
160 func(errorMsg string) { panic(errorMsg) },
161 )
162 shell.Init()
163
164 test.SetupRepo(shell)
165
166 return shell.dir
167}
168
169func testPath(rootdir string) string {
170 return filepath.Join(rootdir, "test")

Callers 1

prepareTestDirFunction · 0.85

Calls 6

InitMethod · 0.95
NewTestEnvironmentFunction · 0.85
NewShellFunction · 0.85
ActualRepoMethod · 0.80
SetupRepoMethod · 0.80
SprintfMethod · 0.65

Tested by

no test coverage detected