@@ -12,7 +12,7 @@ describe('schema', () => {
1212 const schemaOnDisk = readFileSync ( SCHEMA_GRAPHQL_PATH , 'utf8' ) ;
1313
1414 const testSchema = ( schema : string ) => {
15- const gqlConfig = loadGraphQLConfig ( { schema } ) ;
15+ const gqlConfig = loadGraphQLConfig ( { schema, filePath : '' } ) ;
1616 const graphQLSchema = getSchema ( gqlConfig . getDefault ( ) ) ;
1717 expect ( graphQLSchema ) . toBeInstanceOf ( GraphQLSchema ) ;
1818
@@ -87,6 +87,7 @@ describe('schema', () => {
8787 schema : {
8888 [ schemaUrl ] : schemaOptions ,
8989 } ,
90+ filePath : '' ,
9091 } ) ;
9192 const error = getSchema ( gqlConfig . getDefault ( ) ) as Error ;
9293 expect ( error ) . toBeInstanceOf ( Error ) ;
@@ -95,7 +96,7 @@ describe('schema', () => {
9596
9697 // https://github.com/B2o5T/graphql-eslint/blob/master/docs/parser-options.md#schemaoptions
9798 it ( 'with `parserOptions.schemaOptions`' , ( ) => {
98- const gqlConfig = loadGraphQLConfig ( { schema : schemaUrl } ) ;
99+ const gqlConfig = loadGraphQLConfig ( { schema : schemaUrl , filePath : '' } ) ;
99100 const error = getSchema ( gqlConfig . getDefault ( ) , { schemaOptions } ) as Error ;
100101 expect ( error ) . toBeInstanceOf ( Error ) ;
101102 expect ( error . message ) . toMatch ( '"authorization":"Bearer Foo"' ) ;
@@ -105,7 +106,7 @@ describe('schema', () => {
105106
106107 describe ( 'schema loading' , ( ) => {
107108 it ( 'should return Error' , ( ) => {
108- const gqlConfig = loadGraphQLConfig ( { schema : 'not-exist.gql' } ) ;
109+ const gqlConfig = loadGraphQLConfig ( { schema : 'not-exist.gql' , filePath : '' } ) ;
109110 const error = getSchema ( gqlConfig . getDefault ( ) ) as Error ;
110111 expect ( error ) . toBeInstanceOf ( Error ) ;
111112 expect ( error . message ) . toMatch (
@@ -115,9 +116,8 @@ describe('schema', () => {
115116 } ) ;
116117
117118 it ( 'should load the graphql-config rc file relative to the linted file' , ( ) => {
118- const schema = resolve ( __dirname , 'mocks/using-config/schema.graphql' ) ;
119119 const gqlConfig = loadGraphQLConfig ( {
120- schema,
120+ schema : resolve ( __dirname , 'mocks/using-config/schema.graphql' ) ,
121121 filePath : resolve ( __dirname , 'mocks/using-config/test.graphql' ) ,
122122 } ) ;
123123
0 commit comments