clitest

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupMockConfig

func SetupMockConfig(t *testing.T, token, endpoint, activeOrg string) string

SetupMockConfig creates a temporary .crate/config.json and overrides the home directory. It returns the path to the config dir.

func StartMockServer

func StartMockServer(userMock *MockUserService, secretMock *MockSecretService) *httptest.Server

StartMockServer starts an httptest.Server mounting the provided mocks.

Types

type MockSecretService

MockSecretService implements cratev1connect.SecretServiceHandler

func (*MockSecretService) List

func (*MockSecretService) Store

type MockUserService

type MockUserService struct {
	GetProfileFunc func(ctx context.Context, req *connect.Request[cratev1.GetProfileRequest]) (*connect.Response[cratev1.GetProfileResponse], error)
}

MockUserService implements cratev1connect.UserServiceHandler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL