Skip to content

Commit

Permalink
chore: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
vic3lord committed Nov 25, 2024
1 parent e3abc49 commit 95bced0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions route/route_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package route

import (
"context"
"os"
"strings"
"testing"
)

func TestGenerate(t *testing.T) {
if os.Getenv("BUF_TOKEN") == "" {
t.Skip("skipping test; BUF_TOKEN not set")
}
var tests = []struct {
name string
given Module
}{
{"correct mod", Module{URL: "buf.build/vic3lord/bufile"}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ctx := context.Background()
var buf strings.Builder
err := Generate(ctx, tt.given, &buf, Options{})
if err != nil {
t.Errorf("expected nil, actual %v", err)
}
})
}
}

0 comments on commit 95bced0

Please sign in to comment.