From de55566b97f0676026cb0a48e8932c7847946a67 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Fri, 16 Aug 2019 13:30:29 +0300 Subject: [PATCH] tests: use consistent order of fields in snapshots --- src/type/__tests__/definition-test.js | 28 +++++++++---------- src/type/__tests__/directive-test.js | 4 +-- src/type/__tests__/enumType-test.js | 4 +-- .../__tests__/buildClientSchema-test.js | 10 +++---- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/type/__tests__/definition-test.js b/src/type/__tests__/definition-test.js index c352192bbc..a67297f6b9 100644 --- a/src/type/__tests__/definition-test.js +++ b/src/type/__tests__/definition-test.js @@ -187,15 +187,15 @@ describe('Type System: Objects', () => { }); expect(TypeWithDeprecatedField.getFields().bar).to.deep.equal({ - type: ScalarType, - deprecationReason: 'A terrible reason', - isDeprecated: true, name: 'bar', + description: undefined, + type: ScalarType, args: [], - astNode: undefined, resolve: undefined, subscribe: undefined, - description: undefined, + isDeprecated: true, + deprecationReason: 'A terrible reason', + astNode: undefined, }); }); @@ -209,14 +209,14 @@ describe('Type System: Objects', () => { expect(objType.getFields()).to.deep.equal({ f: { name: 'f', + description: undefined, type: ScalarType, args: [], + resolve: undefined, + subscribe: undefined, isDeprecated: false, deprecationReason: undefined, astNode: undefined, - resolve: undefined, - subscribe: undefined, - description: undefined, }, }); }); @@ -236,22 +236,22 @@ describe('Type System: Objects', () => { expect(objType.getFields()).to.deep.equal({ f: { name: 'f', + description: undefined, type: ScalarType, args: [ { name: 'arg', - type: ScalarType, description: null, + type: ScalarType, defaultValue: undefined, astNode: undefined, }, ], + resolve: undefined, + subscribe: undefined, isDeprecated: false, deprecationReason: undefined, astNode: undefined, - resolve: undefined, - subscribe: undefined, - description: undefined, }, }); }); @@ -541,17 +541,17 @@ describe('Type System: Enums', () => { { name: 'NULL', description: undefined, + value: null, isDeprecated: false, deprecationReason: undefined, - value: null, astNode: undefined, }, { name: 'UNDEFINED', description: undefined, + value: undefined, isDeprecated: false, deprecationReason: undefined, - value: undefined, astNode: undefined, }, ]); diff --git a/src/type/__tests__/directive-test.js b/src/type/__tests__/directive-test.js index ff410b0f30..a638e7ac6b 100644 --- a/src/type/__tests__/directive-test.js +++ b/src/type/__tests__/directive-test.js @@ -36,15 +36,15 @@ describe('Type System: Directive', () => { args: [ { name: 'foo', - type: GraphQLString, description: null, + type: GraphQLString, defaultValue: undefined, astNode: undefined, }, { name: 'bar', - type: GraphQLInt, description: null, + type: GraphQLInt, defaultValue: undefined, astNode: undefined, }, diff --git a/src/type/__tests__/enumType-test.js b/src/type/__tests__/enumType-test.js index ce107ea185..6e35fc41e3 100644 --- a/src/type/__tests__/enumType-test.js +++ b/src/type/__tests__/enumType-test.js @@ -341,16 +341,16 @@ describe('Type System: Enum Values', () => { expect(values).to.have.deep.ordered.members([ { name: 'ONE', - value: Complex1, description: undefined, + value: Complex1, isDeprecated: false, deprecationReason: undefined, astNode: undefined, }, { name: 'TWO', - value: Complex2, description: undefined, + value: Complex2, isDeprecated: false, deprecationReason: undefined, astNode: undefined, diff --git a/src/utilities/__tests__/buildClientSchema-test.js b/src/utilities/__tests__/buildClientSchema-test.js index 3eca5702fe..86dabfe4da 100644 --- a/src/utilities/__tests__/buildClientSchema-test.js +++ b/src/utilities/__tests__/buildClientSchema-test.js @@ -358,40 +358,40 @@ describe('Type System: build schema from introspection', () => { expect(clientFoodEnum.getValues()).to.deep.equal([ { name: 'VEGETABLES', - value: 'VEGETABLES', description: 'Foods that are vegetables.', + value: 'VEGETABLES', isDeprecated: false, deprecationReason: null, astNode: undefined, }, { name: 'FRUITS', - value: 'FRUITS', description: 'Foods that are fruits.', + value: 'FRUITS', isDeprecated: false, deprecationReason: null, astNode: undefined, }, { name: 'OILS', - value: 'OILS', description: 'Foods that are oils.', + value: 'OILS', isDeprecated: false, deprecationReason: null, astNode: undefined, }, { name: 'DAIRY', - value: 'DAIRY', description: 'Foods that are dairy.', + value: 'DAIRY', isDeprecated: false, deprecationReason: null, astNode: undefined, }, { name: 'MEAT', - value: 'MEAT', description: 'Foods that are meat.', + value: 'MEAT', isDeprecated: false, deprecationReason: null, astNode: undefined,