@@ -7,13 +7,14 @@ describe("findJSGraphQLTags", () => {
77 const query = graphql\`query findJSGraphQLTagsQuery { hero { id } }\`
88 ` ;
99
10- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
10+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
1111 {
1212 sourceLocationOffset : {
1313 column : 29 ,
1414 line : 3
1515 } ,
16- template : "query findJSGraphQLTagsQuery { hero { id } }"
16+ template : "query findJSGraphQLTagsQuery { hero { id } }" ,
17+ filePath : "Component.js"
1718 }
1819 ] ) ;
1920 } ) ;
@@ -28,13 +29,14 @@ describe("findJSGraphQLTags", () => {
2829 });
2930 ` ;
3031
31- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
32+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
3233 {
3334 sourceLocationOffset : {
3435 column : 21 ,
3536 line : 6
3637 } ,
37- template : "fragment Hero_hero on Hero { id }"
38+ template : "fragment Hero_hero on Hero { id }" ,
39+ filePath : "Component.js"
3840 }
3941 ] ) ;
4042 } ) ;
@@ -47,14 +49,15 @@ describe("findJSGraphQLTags", () => {
4749 graphql\`mutation TestMutation($input: ReviewInput!) { createReview(review: $input) { commentary } }\`;
4850 ` ;
4951
50- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
52+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
5153 {
5254 sourceLocationOffset : {
5355 column : 15 ,
5456 line : 5
5557 } ,
5658 template :
57- "mutation TestMutation($input: ReviewInput!) { createReview(review: $input) { commentary } }"
59+ "mutation TestMutation($input: ReviewInput!) { createReview(review: $input) { commentary } }" ,
60+ filePath : "Component.js"
5861 }
5962 ] ) ;
6063 } ) ;
@@ -66,20 +69,22 @@ describe("findJSGraphQLTags", () => {
6669 const queryTwo = graphql\`query secondQuery { hero { name } }\`
6770 ` ;
6871
69- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
72+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
7073 {
7174 sourceLocationOffset : {
7275 column : 32 ,
7376 line : 3
7477 } ,
75- template : "query firstQuery { hero { id } }"
78+ template : "query firstQuery { hero { id } }" ,
79+ filePath : "Component.js"
7680 } ,
7781 {
7882 sourceLocationOffset : {
7983 column : 32 ,
8084 line : 4
8185 } ,
82- template : "query secondQuery { hero { name } }"
86+ template : "query secondQuery { hero { name } }" ,
87+ filePath : "Component.js"
8388 }
8489 ] ) ;
8590 } ) ;
@@ -90,13 +95,14 @@ describe("findJSGraphQLTags", () => {
9095 const query = gql\`query findJSGraphQLTagsQuery { hero { id } }\`
9196 ` ;
9297
93- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
98+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
9499 {
95100 sourceLocationOffset : {
96101 column : 25 ,
97102 line : 3
98103 } ,
99- template : "query findJSGraphQLTagsQuery { hero { id } }"
104+ template : "query findJSGraphQLTagsQuery { hero { id } }" ,
105+ filePath : "Component.js"
100106 }
101107 ] ) ;
102108 } ) ;
@@ -115,7 +121,7 @@ describe("findJSGraphQLTags", () => {
115121 \`;
116122 ` ;
117123
118- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
124+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
119125 {
120126 sourceLocationOffset : {
121127 column : 40 ,
@@ -129,7 +135,8 @@ describe("findJSGraphQLTags", () => {
129135 }
130136 }
131137 }
132- `
138+ ` ,
139+ filePath : "Component.js"
133140 }
134141 ] ) ;
135142 } ) ;
@@ -156,7 +163,7 @@ describe("findJSGraphQLTags", () => {
156163 };
157164 ` ;
158165
159- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
166+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
160167 {
161168 sourceLocationOffset : {
162169 column : 20 ,
@@ -175,7 +182,8 @@ describe("findJSGraphQLTags", () => {
175182 ...VoteButtons
176183 ...RepoInfo
177184 }
178- `
185+ ` ,
186+ filePath : "Component.js"
179187 }
180188 ] ) ;
181189 } ) ;
@@ -203,7 +211,7 @@ describe("findJSGraphQLTags", () => {
203211 \`;
204212 ` ;
205213
206- expect ( findJSGraphQLTags ( js ) ) . toEqual ( [
214+ expect ( findJSGraphQLTags ( js , "Component.js" ) ) . toEqual ( [
207215 {
208216 sourceLocationOffset : {
209217 column : 40 ,
@@ -227,7 +235,8 @@ describe("findJSGraphQLTags", () => {
227235 createdAt
228236 content
229237 }
230- `
238+ ` ,
239+ filePath : "Component.js"
231240 }
232241 ] ) ;
233242 } ) ;
0 commit comments