From 1845e1f03b00e0a902f29c835ca7a00a5c8007d0 Mon Sep 17 00:00:00 2001 From: samir-tahir Date: Mon, 1 Apr 2024 20:52:39 +0100 Subject: [PATCH] up tests --- internal/controller/githubapp_controller_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/controller/githubapp_controller_test.go b/internal/controller/githubapp_controller_test.go index 93ebe57..978af1e 100644 --- a/internal/controller/githubapp_controller_test.go +++ b/internal/controller/githubapp_controller_test.go @@ -35,6 +35,19 @@ import ( githubappv1 "github-app-operator/api/v1" ) +// fakeClient implements the client.Client interface for testing purposes +type fakeClient struct { + ListFunc func(ctx context.Context, list runtime.Object, opts ...client.ListOption) error +} + +// List mocks the List method of the client.Client interface +func (c *fakeClient) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error { + if c.ListFunc != nil { + return c.ListFunc(ctx, list, opts...) + } + return nil +} + var _ = Describe("GithubApp controller", func() { const (