65d934a705
I set these tests up in #270, but I realized there's a lot more we could test unrelated to that PR. In this commit I add some more tests. They're not really exhaustive yet, but they did catch a few bugs, which I fixed: - we weren't validating the package-name if you do set it (only if we guess it) - If you omitted `generated`, you would try to write generated code to the directory containing `genqlient.yaml`, which makes no sense; now we default to `generated.go`. In the real world it's probably good to set explicitly, but it's actually very convenient in tests that we don't have to, and maybe in small projects too.
28 lines
1.1 KiB
YAML
28 lines
1.1 KiB
YAML
(*generate.Config)({
|
|
Schema: (generate.StringList) (len=2) {
|
|
(string) (len=42) "testdata/valid-config/first_schema.graphql",
|
|
(string) (len=43) "testdata/valid-config/second_schema.graphql"
|
|
},
|
|
Operations: (generate.StringList) (len=2) {
|
|
(string) (len=46) "testdata/valid-config/first_operations.graphql",
|
|
(string) (len=47) "testdata/valid-config/second_operations.graphql"
|
|
},
|
|
Generated: (string) (len=34) "testdata/valid-config/generated.go",
|
|
Package: (string) (len=11) "validConfig",
|
|
ExportOperations: (string) "",
|
|
ContextType: (string) (len=15) "context.Context",
|
|
ClientGetter: (string) "",
|
|
Bindings: (map[string]*generate.TypeBinding) <nil>,
|
|
PackageBindings: ([]*generate.PackageBinding) <nil>,
|
|
Casing: (generate.Casing) {
|
|
AllEnums: (generate.CasingAlgorithm) "",
|
|
Enums: (map[string]generate.CasingAlgorithm) <nil>
|
|
},
|
|
Optional: (string) "",
|
|
OptionalGenericType: (string) "",
|
|
StructReferences: (bool) false,
|
|
Extensions: (bool) false,
|
|
AllowBrokenFeatures: (bool) false,
|
|
baseDir: (string) (len=21) "testdata/valid-config"
|
|
})
|