File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,21 @@ import { printError } from '../printError';
10
10
import { Kind , parse , Source } from '../../language' ;
11
11
12
12
describe ( 'printError' , ( ) => {
13
+ it ( 'prints an error without location' , ( ) => {
14
+ const error = new GraphQLError ( 'Error without location' ) ;
15
+ expect ( printError ( error ) ) . to . equal ( 'Error without location' ) ;
16
+ } ) ;
17
+
18
+ it ( 'prints an error using node without location' , ( ) => {
19
+ const error = new GraphQLError (
20
+ 'Error attached to node without location' ,
21
+ parse ( '{ foo }' , { noLocation : true } ) ,
22
+ ) ;
23
+ expect ( printError ( error ) ) . to . equal (
24
+ 'Error attached to node without location' ,
25
+ ) ;
26
+ } ) ;
27
+
13
28
it ( 'prints an line numbers with correct padding' , ( ) => {
14
29
const singleDigit = new GraphQLError (
15
30
'Single digit line number with no padding' ,
You can’t perform that action at this time.
0 commit comments