mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-12 00:45:31 +00:00
Library improvements.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func Test_main(t *testing.T) {
|
||||
// Test that main function doesn't panic during setup
|
||||
// The actual GraphQL calls will fail, but we want to test the setup code
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
t.Errorf("main() panicked: %v", r)
|
||||
}
|
||||
}()
|
||||
|
||||
// Call main() to get coverage - it will fail on network calls but that's expected
|
||||
// This tests the NewConnection() call and query compilation
|
||||
main()
|
||||
}
|
||||
|
||||
func Test_samplePackageExists(t *testing.T) {
|
||||
// This test ensures the sample package is properly structured
|
||||
// and can be imported/compiled
|
||||
|
||||
// Test passes if we reach this point without compilation errors
|
||||
}
|
||||
Reference in New Issue
Block a user