Avoid putting incorrect extensions on error snapshot files (#92)
## Summary: They were accidentally ending up as `.go` or `.graphql`, but are actually just text. Issue: https://github.com/Khan/genqlient/issues/90 ## Test plan: make check Author: benjaminjkraft Reviewers: StevenACoffman, dnerdy Required Reviewers: Approved By: StevenACoffman Checks: ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint, ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint Pull Request URL: https://github.com/Khan/genqlient/pull/92
This commit is contained in:
@@ -250,8 +250,9 @@ func TestGenerateErrors(t *testing.T) {
|
||||
|
||||
baseFilename := strings.TrimSuffix(sourceFilename, filepath.Ext(sourceFilename))
|
||||
schemaFilename := baseFilename + ".schema.graphql"
|
||||
testFilename := strings.ReplaceAll(sourceFilename, ".", "/")
|
||||
|
||||
t.Run(sourceFilename, func(t *testing.T) {
|
||||
t.Run(testFilename, func(t *testing.T) {
|
||||
_, err := Generate(&Config{
|
||||
Schema: filepath.Join(errorsDir, schemaFilename),
|
||||
Operations: []string{filepath.Join(errorsDir, sourceFilename)},
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
testdata/errors/MissingTypeName.schema.graphql:2: union/interface type I must request __typename
|
||||
@@ -1 +0,0 @@
|
||||
testdata/errors/MissingTypeName.schema.graphql:2: union/interface type I must request __typename
|
||||
Reference in New Issue
Block a user