Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jun 20, 2024
1 parent 69534d1 commit 10dcb77
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions integration/app/cmd_proto_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package app_test
import (
"os"
"path/filepath"
"strings"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -58,6 +59,25 @@ var (
}
)

// TestGenerapAppCheckBufPulsarPath tests scaffolding a new chain and checks if the buf.gen.pulsar.yaml file is correct
func TestGenerapAppCheckBufPulsarPath(t *testing.T) {
var (
env = envtest.New(t)
app = env.Scaffold("github.com/test/blog")
)

bufGenPulsarPath := filepath.Join(app.SourcePath(), "proto", "buf.gen.pulsar.yaml")
_, statErr := os.Stat(bufGenPulsarPath)
require.False(t, os.IsNotExist(statErr), "buf.gen.pulsar.yaml should be scaffolded")

result, err := os.ReadFile(bufGenPulsarPath)
require.NoError(t, err)

require.True(t, strings.Contains(string(result), "default: github.com/test/blog/api"), "buf.gen.pulsar.yaml should contain the correct api override")

app.EnsureSteady()
}

func TestChangeProtoPath(t *testing.T) {
var (
env = envtest.New(t)
Expand Down

0 comments on commit 10dcb77

Please sign in to comment.