@@ -12,7 +12,7 @@ describe('schema', () => {
12
12
const schemaOnDisk = readFileSync ( SCHEMA_GRAPHQL_PATH , 'utf8' ) ;
13
13
14
14
const testSchema = ( schema : string ) => {
15
- const gqlConfig = loadGraphQLConfig ( { schema } ) ;
15
+ const gqlConfig = loadGraphQLConfig ( { schema, filePath : '' } ) ;
16
16
const graphQLSchema = getSchema ( gqlConfig . getDefault ( ) ) ;
17
17
expect ( graphQLSchema ) . toBeInstanceOf ( GraphQLSchema ) ;
18
18
@@ -87,6 +87,7 @@ describe('schema', () => {
87
87
schema : {
88
88
[ schemaUrl ] : schemaOptions ,
89
89
} ,
90
+ filePath : '' ,
90
91
} ) ;
91
92
const error = getSchema ( gqlConfig . getDefault ( ) ) as Error ;
92
93
expect ( error ) . toBeInstanceOf ( Error ) ;
@@ -95,7 +96,7 @@ describe('schema', () => {
95
96
96
97
// https://github.com/B2o5T/graphql-eslint/blob/master/docs/parser-options.md#schemaoptions
97
98
it ( 'with `parserOptions.schemaOptions`' , ( ) => {
98
- const gqlConfig = loadGraphQLConfig ( { schema : schemaUrl } ) ;
99
+ const gqlConfig = loadGraphQLConfig ( { schema : schemaUrl , filePath : '' } ) ;
99
100
const error = getSchema ( gqlConfig . getDefault ( ) , { schemaOptions } ) as Error ;
100
101
expect ( error ) . toBeInstanceOf ( Error ) ;
101
102
expect ( error . message ) . toMatch ( '"authorization":"Bearer Foo"' ) ;
@@ -105,7 +106,7 @@ describe('schema', () => {
105
106
106
107
describe ( 'schema loading' , ( ) => {
107
108
it ( 'should return Error' , ( ) => {
108
- const gqlConfig = loadGraphQLConfig ( { schema : 'not-exist.gql' } ) ;
109
+ const gqlConfig = loadGraphQLConfig ( { schema : 'not-exist.gql' , filePath : '' } ) ;
109
110
const error = getSchema ( gqlConfig . getDefault ( ) ) as Error ;
110
111
expect ( error ) . toBeInstanceOf ( Error ) ;
111
112
expect ( error . message ) . toMatch (
@@ -115,9 +116,8 @@ describe('schema', () => {
115
116
} ) ;
116
117
117
118
it ( 'should load the graphql-config rc file relative to the linted file' , ( ) => {
118
- const schema = resolve ( __dirname , 'mocks/using-config/schema.graphql' ) ;
119
119
const gqlConfig = loadGraphQLConfig ( {
120
- schema,
120
+ schema : resolve ( __dirname , 'mocks/using-config/schema.graphql' ) ,
121
121
filePath : resolve ( __dirname , 'mocks/using-config/test.graphql' ) ,
122
122
} ) ;
123
123
0 commit comments