From 9fb6cf54237a045e057842b3e4b317c9ab5fd783 Mon Sep 17 00:00:00 2001 From: Jeff Hubbard Date: Tue, 12 Apr 2022 10:26:08 -0700 Subject: [PATCH] Fix tests --- pkg/cmd/codespace/create.go | 2 +- pkg/cmd/codespace/create_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/codespace/create.go b/pkg/cmd/codespace/create.go index 521b37437..5bf2c3806 100644 --- a/pkg/cmd/codespace/create.go +++ b/pkg/cmd/codespace/create.go @@ -58,7 +58,7 @@ func (a *App) Create(ctx context.Context, opts createOptions) error { vscsTargetUrl := os.Getenv("VSCS_TARGET_URL") DEFAULT_DEVCONTAINER_DEFINITIONS := []string{".devcontainer.json", ".devcontainer/devcontainer.json"} - + userInputs := struct { Repository string Branch string diff --git a/pkg/cmd/codespace/create_test.go b/pkg/cmd/codespace/create_test.go index 73475097a..3f78a94b2 100644 --- a/pkg/cmd/codespace/create_test.go +++ b/pkg/cmd/codespace/create_test.go @@ -36,6 +36,9 @@ func TestApp_Create(t *testing.T) { DefaultBranch: "main", }, nil }, + ListDevContainersFunc: func(ctx context.Context, repoID int, branch string, limit int) ([]api.DevContainerEntry, error) { + return []api.DevContainerEntry{{Path: ".devcontainer/devcontainer.json"}}, nil + }, GetCodespacesMachinesFunc: func(ctx context.Context, repoID int, branch, location string) ([]*api.Machine, error) { return []*api.Machine{ { @@ -265,6 +268,9 @@ func TestApp_Create(t *testing.T) { DefaultBranch: "main", }, nil }, + ListDevContainersFunc: func(ctx context.Context, repoID int, branch string, limit int) ([]api.DevContainerEntry, error) { + return []api.DevContainerEntry{{Path: ".devcontainer/devcontainer.json"}}, nil + }, GetCodespacesMachinesFunc: func(ctx context.Context, repoID int, branch, location string) ([]*api.Machine, error) { return []*api.Machine{ {