mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-12 00:45:31 +00:00
42 lines
664 B
Go
42 lines
664 B
Go
package gql
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
assertions "github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/suite"
|
|
)
|
|
|
|
type Tests struct {
|
|
suite.Suite
|
|
}
|
|
|
|
var (
|
|
assert *assertions.Assertions
|
|
mockServer *httptest.Server
|
|
)
|
|
|
|
func (suite *Tests) SetupSuite() {
|
|
// Start mock GraphQL server
|
|
mockServer = StartMockServer()
|
|
}
|
|
|
|
func (suite *Tests) TearDownSuite() {
|
|
// Close the mock server
|
|
if mockServer != nil {
|
|
mockServer.Close()
|
|
}
|
|
}
|
|
|
|
func (suite *Tests) SetupTest() {
|
|
assert = assertions.New(suite.T())
|
|
}
|
|
|
|
func (suite *Tests) BeforeTest(suiteName, testName string) {
|
|
}
|
|
|
|
func TestSuite(t *testing.T) {
|
|
suite.Run(t, new(Tests))
|
|
}
|