@@ -12,6 +12,7 @@ import (
12
12
"github.com/stretchr/testify/assert"
13
13
"github.com/stretchr/testify/require"
14
14
"github.com/supabase/cli/internal/testing/apitest"
15
+ "github.com/supabase/cli/internal/testing/pgtest"
15
16
"github.com/supabase/cli/internal/utils"
16
17
"github.com/supabase/cli/pkg/api"
17
18
"gopkg.in/h2non/gock.v1"
@@ -43,8 +44,11 @@ func TestGenLocalCommand(t *testing.T) {
43
44
JSON (types.ContainerJSON {})
44
45
apitest .MockDockerStart (utils .Docker , imageUrl , containerId )
45
46
require .NoError (t , apitest .MockDockerLogs (utils .Docker , containerId , "hello world" ))
47
+ // Setup mock postgres
48
+ conn := pgtest .NewConn ()
49
+ defer conn .Close (t )
46
50
// Run test
47
- assert .NoError (t , Run (context .Background (), "" , dbConfig , []string {}, true , fsys ))
51
+ assert .NoError (t , Run (context .Background (), "" , dbConfig , []string {}, true , fsys , conn . Intercept ))
48
52
// Validate api
49
53
assert .Empty (t , apitest .ListUnmatchedRequests ())
50
54
})
@@ -153,8 +157,11 @@ func TestGenRemoteCommand(t *testing.T) {
153
157
defer gock .OffAll ()
154
158
apitest .MockDockerStart (utils .Docker , imageUrl , containerId )
155
159
require .NoError (t , apitest .MockDockerLogs (utils .Docker , containerId , "hello world" ))
160
+ // Setup mock postgres
161
+ conn := pgtest .NewConn ()
162
+ defer conn .Close (t )
156
163
// Run test
157
- assert .NoError (t , Run (context .Background (), "" , dbConfig , []string {"public" }, true , afero .NewMemMapFs ()))
164
+ assert .NoError (t , Run (context .Background (), "" , dbConfig , []string {"public" }, true , afero .NewMemMapFs (), conn . Intercept ))
158
165
// Validate api
159
166
assert .Empty (t , apitest .ListUnmatchedRequests ())
160
167
})
0 commit comments