mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-18 01:27:25 +00:00
Use the mocks for tests and benchmarks.
This commit is contained in:
+15
-1
@@ -1,6 +1,7 @@
|
||||
package gql
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
assertions "github.com/stretchr/testify/assert"
|
||||
@@ -12,9 +13,22 @@ type Tests struct {
|
||||
}
|
||||
|
||||
var (
|
||||
assert *assertions.Assertions
|
||||
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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user