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:
Ben Kraft
2021-09-14 10:30:33 -07:00
committed by GitHub
parent 9804d42e2f
commit 639b46df32
17 changed files with 2 additions and 3 deletions
+2 -1
View File
@@ -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