Skip to content

Commit bd2cd6b

Browse files
committed
add parser test
1 parent a89425b commit bd2cd6b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/language/__tests__/parser.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ fragment MissingOn Type
6969
).to.throw('Syntax Error GraphQL (1:10) Unexpected Name "on"');
7070
});
7171

72+
it('does not accept fragments spread of "on"', () => {
73+
expect(
74+
() => parse('{ ...on }')
75+
).to.throw('Syntax Error GraphQL (1:9) Expected Name, found }');
76+
});
77+
7278
var kitchenSink = readFileSync(
7379
join(__dirname, '/kitchen-sink.graphql'),
7480
{ encoding: 'utf8' }

0 commit comments

Comments
 (0)