Skip to content

Commit dd3ed1c

Browse files
introspection-test: improve testing of trivial resolvers (#2709)
1 parent b14de03 commit dd3ed1c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/type/__tests__/introspection-test.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,20 +1319,36 @@ describe('Introspection', () => {
13191319
});
13201320
});
13211321

1322-
it('executes an introspection query without calling global fieldResolver', () => {
1322+
it('executes an introspection query without calling global resolvers', () => {
13231323
const schema = buildSchema(`
13241324
type Query {
13251325
someField: String
13261326
}
13271327
`);
13281328

1329-
const source = getIntrospectionQuery({ directiveIsRepeatable: true });
1329+
const source = getIntrospectionQuery({
1330+
specifiedByUrl: true,
1331+
directiveIsRepeatable: true,
1332+
schemaDescription: true,
1333+
});
13301334

13311335
// istanbul ignore next (Called only to fail test)
13321336
function fieldResolver(_1, _2, _3, info) {
13331337
invariant(false, `Called on ${info.parentType.name}::${info.fieldName}`);
13341338
}
13351339

1336-
expect(() => graphqlSync({ schema, source, fieldResolver })).to.not.throw();
1340+
// istanbul ignore next (Called only to fail test)
1341+
function typeResolver(_1, _2, info) {
1342+
invariant(false, `Called on ${info.parentType.name}::${info.fieldName}`);
1343+
}
1344+
1345+
expect(() =>
1346+
graphqlSync({
1347+
schema,
1348+
source,
1349+
fieldResolver,
1350+
typeResolver,
1351+
}),
1352+
).to.not.throw();
13371353
});
13381354
});

0 commit comments

Comments
 (0)