mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-17 01:17:43 +00:00
Updates.
This commit is contained in:
+18
-2
@@ -2,6 +2,7 @@ package gql
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
assertions "github.com/stretchr/testify/assert"
|
||||
@@ -13,11 +14,19 @@ type Tests struct {
|
||||
}
|
||||
|
||||
var (
|
||||
assert *assertions.Assertions
|
||||
mockServer *httptest.Server
|
||||
assert *assertions.Assertions
|
||||
mockServer *httptest.Server
|
||||
originalInsecureSkipValue string
|
||||
)
|
||||
|
||||
func (suite *Tests) SetupSuite() {
|
||||
// Save original environment variable value
|
||||
originalInsecureSkipValue = os.Getenv("GRAPHQL_INSECURE_SKIP_VERIFY")
|
||||
|
||||
// Set environment variable to skip TLS verification for test mock server
|
||||
// The mock server uses self-signed certificates
|
||||
os.Setenv("GRAPHQL_INSECURE_SKIP_VERIFY", "true")
|
||||
|
||||
// Start mock GraphQL server
|
||||
mockServer = StartMockServer()
|
||||
}
|
||||
@@ -30,6 +39,13 @@ func (suite *Tests) TearDownSuite() {
|
||||
|
||||
// Cleanup shared test cache
|
||||
CleanupTestCache()
|
||||
|
||||
// Restore original environment variable value
|
||||
if originalInsecureSkipValue != "" {
|
||||
os.Setenv("GRAPHQL_INSECURE_SKIP_VERIFY", originalInsecureSkipValue)
|
||||
} else {
|
||||
os.Unsetenv("GRAPHQL_INSECURE_SKIP_VERIFY")
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *Tests) SetupTest() {
|
||||
|
||||
Reference in New Issue
Block a user