1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

various changes to improve integration tests

This commit is contained in:
Jesse Duffield
2022-09-09 21:11:05 -07:00
parent 7b757d1cfe
commit 7af7af27c6
103 changed files with 2883 additions and 1525 deletions

View File

@ -58,11 +58,11 @@ func RunTests(
for _, test := range tests {
test := test
paths := NewPaths(
filepath.Join(testDir, test.Name()),
)
testWrapper(test, func() error { //nolint: thelper
paths := NewPaths(
filepath.Join(testDir, test.Name()),
)
return runTest(test, paths, projectRootDir, logf, runCmd, mode, keyPressDelay)
})
}
@ -126,16 +126,7 @@ func buildLazygit() error {
}
func createFixture(test *IntegrationTest, paths Paths) error {
originalDir, err := os.Getwd()
if err != nil {
return err
}
if err := os.Chdir(paths.ActualRepo()); err != nil {
panic(err)
}
shell := NewShell()
shell := NewShell(paths.ActualRepo())
shell.RunCommand("git init -b master")
shell.RunCommand(`git config user.email "CI@example.com"`)
shell.RunCommand(`git config user.name "CI"`)
@ -143,10 +134,6 @@ func createFixture(test *IntegrationTest, paths Paths) error {
test.SetupRepo(shell)
if err := os.Chdir(originalDir); err != nil {
panic(err)
}
return nil
}