Skip to content

Commit

Permalink
tests: replace invariant with assertEnumType (#1952)
Browse files Browse the repository at this point in the history
Motivation: Improves code coverage
  • Loading branch information
IvanGoncharov committed Jun 6, 2019
1 parent 27465b2 commit a034dc2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/utilities/__tests__/buildClientSchema-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
import { describe, it } from 'mocha';
import { expect } from 'chai';
import dedent from '../../jsutils/dedent';
import invariant from '../../jsutils/invariant';
import { buildClientSchema } from '../buildClientSchema';
import { introspectionFromSchema } from '../introspectionFromSchema';
import {
buildSchema,
printSchema,
graphqlSync,
isEnumType,
assertEnumType,
GraphQLSchema,
GraphQLObjectType,
GraphQLEnumType,
Expand Down Expand Up @@ -336,10 +335,8 @@ describe('Type System: build schema from introspection', () => {
const secondIntrospection = introspectionFromSchema(clientSchema);
expect(secondIntrospection).to.deep.equal(introspection);

const clientFoodEnum = clientSchema.getType('Food');

// It's also an Enum type on the client.
invariant(isEnumType(clientFoodEnum));
const clientFoodEnum = assertEnumType(clientSchema.getType('Food'));

// Client types do not get server-only values, so `value` mirrors `name`,
// rather than using the integers defined in the "server" schema.
Expand Down

0 comments on commit a034dc2

Please sign in to comment.