@@ -23,7 +23,8 @@ describe('Lexer', () => {
23
23
24
24
expect ( ( ) => lexOne ( '\u0007' )
25
25
) . to . throw (
26
- 'Syntax Error GraphQL (1:1) Invalid character "\\u0007"'
26
+ 'Syntax Error GraphQL (1:1) ' +
27
+ 'Cannot contain the invalid character "\\u0007"'
27
28
) ;
28
29
29
30
} ) ;
@@ -106,7 +107,8 @@ describe('Lexer', () => {
106
107
107
108
` )
108
109
) . to . throw (
109
- 'Syntax Error GraphQL (3:5) Unexpected character "?".\n' +
110
+ 'Syntax Error GraphQL (3:5) ' +
111
+ 'Cannot parse the unexpected character "?".\n' +
110
112
'\n' +
111
113
'2: \n' +
112
114
'3: ?\n' +
@@ -178,11 +180,18 @@ describe('Lexer', () => {
178
180
179
181
expect (
180
182
( ) => lexOne ( '"' )
181
- ) . to . throw ( 'Syntax Error GraphQL (1:2) Unterminated string' ) ;
183
+ ) . to . throw ( 'Syntax Error GraphQL (1:2) Unterminated string. ' ) ;
182
184
183
185
expect (
184
186
( ) => lexOne ( '"no end quote' )
185
- ) . to . throw ( 'Syntax Error GraphQL (1:14) Unterminated string' ) ;
187
+ ) . to . throw ( 'Syntax Error GraphQL (1:14) Unterminated string.' ) ;
188
+
189
+ expect (
190
+ ( ) => lexOne ( '\'single quotes\'' )
191
+ ) . to . throw (
192
+ 'Syntax Error GraphQL (1:1) Unexpected single quote character (\'), ' +
193
+ 'did you mean to use a double quote (")?'
194
+ ) ;
186
195
187
196
expect (
188
197
( ) => lexOne ( '"contains unescaped \u0007 control char"' )
@@ -406,7 +415,9 @@ describe('Lexer', () => {
406
415
407
416
expect (
408
417
( ) => lexOne ( '+1' )
409
- ) . to . throw ( 'Syntax Error GraphQL (1:1) Unexpected character "+"' ) ;
418
+ ) . to . throw (
419
+ 'Syntax Error GraphQL (1:1) Cannot parse the unexpected character "+".'
420
+ ) ;
410
421
411
422
expect (
412
423
( ) => lexOne ( '1.' )
@@ -417,7 +428,9 @@ describe('Lexer', () => {
417
428
418
429
expect (
419
430
( ) => lexOne ( '.123' )
420
- ) . to . throw ( 'Syntax Error GraphQL (1:1) Unexpected character "."' ) ;
431
+ ) . to . throw (
432
+ 'Syntax Error GraphQL (1:1) Cannot parse the unexpected character ".".'
433
+ ) ;
421
434
422
435
expect (
423
436
( ) => lexOne ( '1.A' )
@@ -572,19 +585,29 @@ describe('Lexer', () => {
572
585
573
586
expect (
574
587
( ) => lexOne ( '..' )
575
- ) . to . throw ( 'Syntax Error GraphQL (1:1) Unexpected character "."' ) ;
588
+ ) . to . throw (
589
+ 'Syntax Error GraphQL (1:1) Cannot parse the unexpected character ".".'
590
+ ) ;
576
591
577
592
expect (
578
593
( ) => lexOne ( '?' )
579
- ) . to . throw ( 'Syntax Error GraphQL (1:1) Unexpected character "?"' ) ;
594
+ ) . to . throw (
595
+ 'Syntax Error GraphQL (1:1) Cannot parse the unexpected character "?".'
596
+ ) ;
580
597
581
598
expect (
582
599
( ) => lexOne ( '\u203B' )
583
- ) . to . throw ( 'Syntax Error GraphQL (1:1) Unexpected character "\\u203B"' ) ;
600
+ ) . to . throw (
601
+ 'Syntax Error GraphQL (1:1) ' +
602
+ 'Cannot parse the unexpected character "\\u203B".'
603
+ ) ;
584
604
585
605
expect (
586
606
( ) => lexOne ( '\u200b' )
587
- ) . to . throw ( 'Syntax Error GraphQL (1:1) Unexpected character "\\u200B"' ) ;
607
+ ) . to . throw (
608
+ 'Syntax Error GraphQL (1:1) ' +
609
+ 'Cannot parse the unexpected character "\\u200B".'
610
+ ) ;
588
611
} ) ;
589
612
590
613
it ( 'lex reports useful information for dashes in names' , ( ) => {
0 commit comments