Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bannzai committed Jan 12, 2022
1 parent 4de6a6a commit a159e6a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nodecheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ func TestWithMultipleExclusion(t *testing.T) {
testdata := analysistest.TestData(t)
analysistest.Run(t, testdata, nodecheck.Analyzer("Community,Item"), "c")
}

func TestWithRegex(t *testing.T) {
testdata := analysistest.TestData(t)
analysistest.Run(t, testdata, nodecheck.Analyzer(".+Payload"), "d")
}
17 changes: 17 additions & 0 deletions testdata/d/schema/model.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
interface Node {
id: ID!
}

type User implements Node {
id: ID!
}

# Invalid. id is not exists
type CommunityPayload {
name: String!
}

# Invalid. id is exists but not conform to Node
type ItemPayload {
id: ID!
}

0 comments on commit a159e6a

Please sign in to comment.