@@ -49,7 +49,7 @@ describe('coerceInputValue', () => {
49
49
const result = coerceValue ( undefined , TestNonNull ) ;
50
50
expectErrors ( result ) . to . deep . equal ( [
51
51
{
52
- error : 'Expected non-nullable type Int! not to be null.' ,
52
+ error : 'Expected non-nullable type " Int!" not to be null.' ,
53
53
path : [ ] ,
54
54
value : undefined ,
55
55
} ,
@@ -60,7 +60,7 @@ describe('coerceInputValue', () => {
60
60
const result = coerceValue ( null , TestNonNull ) ;
61
61
expectErrors ( result ) . to . deep . equal ( [
62
62
{
63
- error : 'Expected non-nullable type Int! not to be null.' ,
63
+ error : 'Expected non-nullable type " Int!" not to be null.' ,
64
64
path : [ ] ,
65
65
value : null ,
66
66
} ,
@@ -99,7 +99,7 @@ describe('coerceInputValue', () => {
99
99
const result = coerceValue ( { value : undefined } , TestScalar ) ;
100
100
expectErrors ( result ) . to . deep . equal ( [
101
101
{
102
- error : 'Expected type TestScalar.' ,
102
+ error : 'Expected type " TestScalar" .' ,
103
103
path : [ ] ,
104
104
value : { value : undefined } ,
105
105
} ,
@@ -111,7 +111,7 @@ describe('coerceInputValue', () => {
111
111
const result = coerceValue ( inputValue , TestScalar ) ;
112
112
expectErrors ( result ) . to . deep . equal ( [
113
113
{
114
- error : 'Expected type TestScalar. Some error message' ,
114
+ error : 'Expected type " TestScalar" . Some error message' ,
115
115
path : [ ] ,
116
116
value : { error : 'Some error message' } ,
117
117
} ,
@@ -140,7 +140,7 @@ describe('coerceInputValue', () => {
140
140
const result = coerceValue ( 'foo' , TestEnum ) ;
141
141
expectErrors ( result ) . to . deep . equal ( [
142
142
{
143
- error : 'Expected type TestEnum. Did you mean FOO?' ,
143
+ error : 'Expected type " TestEnum" . Did you mean the enum value " FOO" ?' ,
144
144
path : [ ] ,
145
145
value : 'foo' ,
146
146
} ,
@@ -151,7 +151,7 @@ describe('coerceInputValue', () => {
151
151
const result1 = coerceValue ( 123 , TestEnum ) ;
152
152
expectErrors ( result1 ) . to . deep . equal ( [
153
153
{
154
- error : 'Expected type TestEnum.' ,
154
+ error : 'Expected type " TestEnum" .' ,
155
155
path : [ ] ,
156
156
value : 123 ,
157
157
} ,
@@ -160,7 +160,7 @@ describe('coerceInputValue', () => {
160
160
const result2 = coerceValue ( { field : 'value' } , TestEnum ) ;
161
161
expectErrors ( result2 ) . to . deep . equal ( [
162
162
{
163
- error : 'Expected type TestEnum.' ,
163
+ error : 'Expected type " TestEnum" .' ,
164
164
path : [ ] ,
165
165
value : { field : 'value' } ,
166
166
} ,
@@ -186,7 +186,7 @@ describe('coerceInputValue', () => {
186
186
const result = coerceValue ( 123 , TestInputObject ) ;
187
187
expectErrors ( result ) . to . deep . equal ( [
188
188
{
189
- error : 'Expected type TestInputObject to be an object.' ,
189
+ error : 'Expected type " TestInputObject" to be an object.' ,
190
190
path : [ ] ,
191
191
value : 123 ,
192
192
} ,
@@ -198,7 +198,7 @@ describe('coerceInputValue', () => {
198
198
expectErrors ( result ) . to . deep . equal ( [
199
199
{
200
200
error :
201
- 'Expected type Int. Int cannot represent non-integer value: NaN' ,
201
+ 'Expected type " Int" . Int cannot represent non-integer value: NaN' ,
202
202
path : [ 'foo' ] ,
203
203
value : NaN ,
204
204
} ,
@@ -210,13 +210,13 @@ describe('coerceInputValue', () => {
210
210
expectErrors ( result ) . to . deep . equal ( [
211
211
{
212
212
error :
213
- 'Expected type Int. Int cannot represent non-integer value: "abc"' ,
213
+ 'Expected type " Int" . Int cannot represent non-integer value: "abc"' ,
214
214
path : [ 'foo' ] ,
215
215
value : 'abc' ,
216
216
} ,
217
217
{
218
218
error :
219
- 'Expected type Int. Int cannot represent non-integer value: "def"' ,
219
+ 'Expected type " Int" . Int cannot represent non-integer value: "def"' ,
220
220
path : [ 'bar' ] ,
221
221
value : 'def' ,
222
222
} ,
@@ -227,7 +227,7 @@ describe('coerceInputValue', () => {
227
227
const result = coerceValue ( { bar : 123 } , TestInputObject ) ;
228
228
expectErrors ( result ) . to . deep . equal ( [
229
229
{
230
- error : 'Field foo of required type Int! was not provided.' ,
230
+ error : 'Field " foo" of required type " Int!" was not provided.' ,
231
231
path : [ ] ,
232
232
value : { bar : 123 } ,
233
233
} ,
@@ -241,7 +241,8 @@ describe('coerceInputValue', () => {
241
241
) ;
242
242
expectErrors ( result ) . to . deep . equal ( [
243
243
{
244
- error : 'Field "unknownField" is not defined by type TestInputObject.' ,
244
+ error :
245
+ 'Field "unknownField" is not defined by type "TestInputObject".' ,
245
246
path : [ ] ,
246
247
value : { foo : 123 , unknownField : 123 } ,
247
248
} ,
@@ -253,7 +254,7 @@ describe('coerceInputValue', () => {
253
254
expectErrors ( result ) . to . deep . equal ( [
254
255
{
255
256
error :
256
- 'Field "bart" is not defined by type TestInputObject. Did you mean bar?' ,
257
+ 'Field "bart" is not defined by type " TestInputObject" . Did you mean " bar" ?' ,
257
258
path : [ ] ,
258
259
value : { foo : 123 , bart : 123 } ,
259
260
} ,
@@ -309,13 +310,13 @@ describe('coerceInputValue', () => {
309
310
expectErrors ( result ) . to . deep . equal ( [
310
311
{
311
312
error :
312
- 'Expected type Int. Int cannot represent non-integer value: "b"' ,
313
+ 'Expected type " Int" . Int cannot represent non-integer value: "b"' ,
313
314
path : [ 1 ] ,
314
315
value : 'b' ,
315
316
} ,
316
317
{
317
318
error :
318
- 'Expected type Int. Int cannot represent non-integer value: true' ,
319
+ 'Expected type " Int" . Int cannot represent non-integer value: true' ,
319
320
path : [ 2 ] ,
320
321
value : true ,
321
322
} ,
@@ -332,7 +333,7 @@ describe('coerceInputValue', () => {
332
333
expectErrors ( result ) . to . deep . equal ( [
333
334
{
334
335
error :
335
- 'Expected type Int. Int cannot represent non-integer value: "INVALID"' ,
336
+ 'Expected type " Int" . Int cannot represent non-integer value: "INVALID"' ,
336
337
path : [ ] ,
337
338
value : 'INVALID' ,
338
339
} ,
@@ -377,15 +378,15 @@ describe('coerceInputValue', () => {
377
378
describe ( 'with default onError' , ( ) => {
378
379
it ( 'throw error without path' , ( ) => {
379
380
expect ( ( ) => coerceInputValue ( null , GraphQLNonNull ( GraphQLInt ) ) ) . to . throw (
380
- 'Invalid value null: Expected non-nullable type Int! not to be null.' ,
381
+ 'Invalid value null: Expected non-nullable type " Int!" not to be null.' ,
381
382
) ;
382
383
} ) ;
383
384
384
385
it ( 'throw error with path' , ( ) => {
385
386
expect ( ( ) =>
386
387
coerceInputValue ( [ null ] , GraphQLList ( GraphQLNonNull ( GraphQLInt ) ) ) ,
387
388
) . to . throw (
388
- 'Invalid value null at "value[0]": : Expected non-nullable type Int! not to be null.' ,
389
+ 'Invalid value null at "value[0]": : Expected non-nullable type " Int!" not to be null.' ,
389
390
) ;
390
391
} ) ;
391
392
} ) ;
0 commit comments