1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Fix tests

We now change directories to the repo on startup so we don't need to determine the test path in some special way
This commit is contained in:
Jesse Duffield
2023-07-17 17:13:56 +10:00
parent eeec373728
commit 7569180cac

View File

@ -8,7 +8,6 @@ import (
"github.com/jesseduffield/generics/slices" "github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/git_commands"
"github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/env"
integrationTypes "github.com/jesseduffield/lazygit/pkg/integration/types" integrationTypes "github.com/jesseduffield/lazygit/pkg/integration/types"
"github.com/jesseduffield/lazygit/pkg/utils" "github.com/jesseduffield/lazygit/pkg/utils"
) )
@ -170,11 +169,12 @@ func (self *IntegrationTest) SetupRepo(shell *Shell) {
} }
func (self *IntegrationTest) Run(gui integrationTypes.GuiDriver) { func (self *IntegrationTest) Run(gui integrationTypes.GuiDriver) {
// we pass the --pass arg to lazygit when running an integration test, and that pwd, err := os.Getwd()
// ends up stored in the following env var if err != nil {
repoPath := env.GetGitWorkTreeEnv() panic(err)
}
shell := NewShell(repoPath, func(errorMsg string) { gui.Fail(errorMsg) }) shell := NewShell(pwd, func(errorMsg string) { gui.Fail(errorMsg) })
keys := gui.Keys() keys := gui.Keys()
testDriver := NewTestDriver(gui, shell, keys, KeyPressDelay()) testDriver := NewTestDriver(gui, shell, keys, KeyPressDelay())