From 1eb28c7735e751a0fd737ef46c0f1149e39bf191 Mon Sep 17 00:00:00 2001 From: Saihajpreet Singh Date: Wed, 14 Apr 2021 10:03:54 -0500 Subject: [PATCH] remove this commit after #3039 is merged --- src/type/__tests__/predicate-test.ts | 30 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/type/__tests__/predicate-test.ts b/src/type/__tests__/predicate-test.ts index d4cb4e2a060..94e152e1aa1 100644 --- a/src/type/__tests__/predicate-test.ts +++ b/src/type/__tests__/predicate-test.ts @@ -1,7 +1,11 @@ import { expect } from 'chai'; import { describe, it } from 'mocha'; -import type { GraphQLArgument, GraphQLInputField } from '../definition'; +import type { + GraphQLArgument, + GraphQLInputField, + GraphQLInputType, +} from '../definition'; import { GraphQLDirective, GraphQLSkipDirective, @@ -503,7 +507,7 @@ describe('Type predicates', () => { describe('getNullableType', () => { it('returns undefined for no type', () => { - expect(getNullableType()).to.equal(undefined); + expect(getNullableType(undefined)).to.equal(undefined); expect(getNullableType(null)).to.equal(undefined); }); @@ -536,7 +540,7 @@ describe('Type predicates', () => { describe('getNamedType', () => { it('returns undefined for no type', () => { - expect(getNamedType()).to.equal(undefined); + expect(getNamedType(undefined)).to.equal(undefined); expect(getNamedType(null)).to.equal(undefined); }); @@ -559,15 +563,18 @@ describe('Type predicates', () => { }); describe('isRequiredArgument', () => { - function buildArg(config: Partial): GraphQLArgument { + function buildArg(config: { + type: GraphQLInputType; + defaultValue?: unknown; + }): GraphQLArgument { return { name: 'someArg', + type: config.type, description: undefined, - defaultValue: undefined, + defaultValue: config.defaultValue, deprecationReason: null, extensions: undefined, astNode: undefined, - ...config, }; } @@ -604,17 +611,18 @@ describe('Type predicates', () => { }); describe('isRequiredInputField', () => { - function buildInputField( - config: Partial, - ): GraphQLInputField { + function buildInputField(config: { + type: GraphQLInputType; + defaultValue?: unknown; + }): GraphQLInputField { return { name: 'someInputField', + type: config.type, description: undefined, - defaultValue: undefined, + defaultValue: config.defaultValue, deprecationReason: null, extensions: undefined, astNode: undefined, - ...config, }; }