@@ -37,6 +37,31 @@ describe('findBreakingChanges', () => {
37
37
expect ( findBreakingChanges ( oldSchema , oldSchema ) ) . to . deep . equal ( [ ] ) ;
38
38
} ) ;
39
39
40
+ it ( 'should detect if a standard scalar was removed' , ( ) => {
41
+ const oldSchema = buildSchema ( `
42
+ type Query {
43
+ foo: Float
44
+ }
45
+ ` ) ;
46
+
47
+ const newSchema = buildSchema ( `
48
+ type Query {
49
+ foo: String
50
+ }
51
+ ` ) ;
52
+ expect ( findBreakingChanges ( oldSchema , newSchema ) ) . to . deep . equal ( [
53
+ {
54
+ type : BreakingChangeType . TYPE_REMOVED ,
55
+ description : 'Standard scalar Float was removed because it is not referenced anymore.' ,
56
+ } ,
57
+ {
58
+ type : BreakingChangeType . FIELD_CHANGED_KIND ,
59
+ description : 'Query.foo changed type from Float to String.' ,
60
+ }
61
+ ] ) ;
62
+ expect ( findBreakingChanges ( oldSchema , oldSchema ) ) . to . deep . equal ( [ ] ) ;
63
+ } ) ;
64
+
40
65
it ( 'should detect if a type changed its type' , ( ) => {
41
66
const oldSchema = buildSchema ( `
42
67
scalar TypeWasScalarBecomesEnum
@@ -601,7 +626,7 @@ describe('findBreakingChanges', () => {
601
626
directive @DirectiveName on FIELD_DEFINITION | QUERY
602
627
603
628
type ArgThatChanges {
604
- field1(id: Int ): String
629
+ field1(id: Float ): String
605
630
}
606
631
607
632
enum EnumTypeThatLosesAValue {
@@ -660,7 +685,7 @@ describe('findBreakingChanges', () => {
660
685
expect ( findBreakingChanges ( oldSchema , newSchema ) ) . to . deep . equal ( [
661
686
{
662
687
type : BreakingChangeType . TYPE_REMOVED ,
663
- description : 'Int was removed.' ,
688
+ description : 'Standard scalar Float was removed because it is not referenced anymore .' ,
664
689
} ,
665
690
{
666
691
type : BreakingChangeType . TYPE_REMOVED ,
@@ -669,7 +694,7 @@ describe('findBreakingChanges', () => {
669
694
{
670
695
type : BreakingChangeType . ARG_CHANGED_KIND ,
671
696
description :
672
- 'ArgThatChanges.field1 arg id has changed type from Int to String.' ,
697
+ 'ArgThatChanges.field1 arg id has changed type from Float to String.' ,
673
698
} ,
674
699
{
675
700
type : BreakingChangeType . VALUE_REMOVED_FROM_ENUM ,
0 commit comments