Update git/client_test.go

Co-authored-by: Andy Feller <andyfeller@github.com>
This commit is contained in:
William Martin 2024-11-27 15:51:44 +01:00 committed by GitHub
parent 622e283d2b
commit ec086a021b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1655,6 +1655,7 @@ func createMockedCommandContext(t *testing.T, commands mockedCommands) commandCt
marshaledCommands, err := json.Marshal(commands)
require.NoError(t, err)
// invokes helper within current test binary, emulating desired behavior
return func(ctx context.Context, exe string, args ...string) *exec.Cmd {
cmd := exec.CommandContext(context.Background(), os.Args[0], "-test.run=TestCommandMocking", "--")
cmd.Env = []string{