mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 05:56:38 +08:00
22 lines
525 B
Go
22 lines
525 B
Go
package router_test
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestGeneratedSwaggerSpecExists(t *testing.T) {
|
|
data, err := os.ReadFile("../docs/swagger.json")
|
|
if err != nil {
|
|
t.Fatalf("failed to read generated swagger spec: %v", err)
|
|
}
|
|
content := string(data)
|
|
if !strings.Contains(content, "\"title\": \"OpenFlare Server API\"") {
|
|
t.Fatal("expected swagger spec title to exist")
|
|
}
|
|
if !strings.Contains(content, "\"/api/proxy-routes/\"") {
|
|
t.Fatal("expected swagger spec to contain proxy route endpoint")
|
|
}
|
|
}
|