Skip to content

Commit 42e9492

Browse files
author
Daniel Woelfel
committed
wincent's feedback
1 parent a5307b7 commit 42e9492

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/language/__tests__/lexer-test.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,13 @@ describe('Lexer', () => {
101101
});
102102

103103
it('errors respect whitespace', () => {
104-
const str = '' +
105-
'\n' +
106-
'\n' +
107-
' ?\n' +
108-
'\n';
109-
expect(() => lexOne(str)
104+
105+
expect(() => lexOne(`
106+
107+
?
108+
109+
110+
`)
110111
).to.throw(
111112
'Syntax Error GraphQL request (3:5) ' +
112113
'Cannot parse the unexpected character "?".\n' +
@@ -116,6 +117,7 @@ describe('Lexer', () => {
116117
' ^\n' +
117118
'4: \n'
118119
);
120+
119121
});
120122

121123
it('updates line numbers in error for file context', () => {
@@ -126,7 +128,7 @@ describe('Lexer', () => {
126128
' ?\n' +
127129
'\n';
128130
const source = new Source(str, 'foo.js', { line: 11, column: 0 });
129-
return createLexer(source).advance()
131+
return createLexer(source).advance();
130132
}).to.throw(
131133
'Syntax Error foo.js (13:5) ' +
132134
'Cannot parse the unexpected character "?".\n' +

0 commit comments

Comments
 (0)