Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findBreakingChanges: merge funcs and remove duplicated iteration logic #1911

Merged
merged 1 commit into from May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 18 additions & 18 deletions src/utilities/__tests__/findBreakingChanges-test.js
Expand Up @@ -676,38 +676,38 @@ describe('findBreakingChanges', () => {
description: 'TypeThatGetsRemoved was removed.',
},
{
type: BreakingChangeType.TYPE_CHANGED_KIND,
type: BreakingChangeType.ARG_CHANGED_KIND,
description:
'TypeThatChangesType changed from an Object type to an Interface type.',
'ArgThatChanges.field1 arg id has changed type from Int to String.',
},
{
type: BreakingChangeType.FIELD_REMOVED,
description: 'TypeThatHasBreakingFieldChanges.field1 was removed.',
type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,
description:
'VALUE0 was removed from enum type EnumTypeThatLosesAValue.',
},
{
type: BreakingChangeType.FIELD_CHANGED_KIND,
type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT,
description:
'TypeThatHasBreakingFieldChanges.field2 changed type from String to Boolean.',
'TypeThatLooseInterface1 no longer implements interface Interface1.',
},
{
type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,
description:
'TypeInUnion2 was removed from union type UnionTypeThatLosesAType.',
},
{
type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,
type: BreakingChangeType.TYPE_CHANGED_KIND,
description:
'VALUE0 was removed from enum type EnumTypeThatLosesAValue.',
'TypeThatChangesType changed from an Object type to an Interface type.',
},
{
type: BreakingChangeType.ARG_CHANGED_KIND,
description:
'ArgThatChanges.field1 arg id has changed type from Int to String.',
type: BreakingChangeType.FIELD_REMOVED,
description: 'TypeThatHasBreakingFieldChanges.field1 was removed.',
},
{
type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT,
type: BreakingChangeType.FIELD_CHANGED_KIND,
description:
'TypeThatLooseInterface1 no longer implements interface Interface1.',
'TypeThatHasBreakingFieldChanges.field2 changed type from String to Boolean.',
},
{
type: BreakingChangeType.DIRECTIVE_REMOVED,
Expand Down Expand Up @@ -972,11 +972,6 @@ describe('findDangerousChanges', () => {
`);

expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([
{
type: DangerousChangeType.TYPE_ADDED_TO_UNION,
description:
'TypeInUnion2 was added to union type UnionTypeThatGainsAType.',
},
{
type: DangerousChangeType.VALUE_ADDED_TO_ENUM,
description: 'VALUE2 was added to enum type EnumType1.',
Expand All @@ -991,6 +986,11 @@ describe('findDangerousChanges', () => {
description:
'Interface1 added to interfaces implemented by TypeThatGainsInterface1.',
},
{
type: DangerousChangeType.TYPE_ADDED_TO_UNION,
description:
'TypeInUnion2 was added to union type UnionTypeThatGainsAType.',
},
]);
});

Expand Down