mirror of
https://github.com/foomo/gotsrpc.git
synced 2026-04-28 08:34:31 +00:00
22 lines
511 B
Go
22 lines
511 B
Go
package main_test
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"os"
|
|
"os/exec"
|
|
"testing"
|
|
|
|
"github.com/foomo/gotsrpc/v2/tests/errors/server"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestClient(t *testing.T) {
|
|
s := httptest.NewServer(server.NewDefaultServiceGoTSRPCProxy(&server.Handler{}))
|
|
cmd := exec.CommandContext(t.Context(), "bun", "test", "./client/client.test.ts")
|
|
cmd.Stdout = os.Stdout
|
|
cmd.Stderr = os.Stderr
|
|
|
|
cmd.Env = append(os.Environ(), "GOTSRPC_SERVER_URL="+s.URL)
|
|
require.NoError(t, cmd.Run())
|
|
}
|