From 2a0173c7d8c9e1e94551cfaf3999aba9170c1baf Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Thu, 14 May 2026 16:32:48 +0300 Subject: [PATCH] chore(tests): add test for directive extensions without flag enabled (#4738) The branch in parseTypeSystemExtension where the 'directive' keyword is encountered but the parsing option was not enabled was apparently NOT covered prior to addition to this test, falsely reported by our imperfect tooling as covered. At least it appears. This was uncovered by formatting changed of other pending work; the addition of this test should narrow the diff of any other changes. --- src/language/__tests__/schema-parser-test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/language/__tests__/schema-parser-test.ts b/src/language/__tests__/schema-parser-test.ts index 38358a676b..d98ab63b7c 100644 --- a/src/language/__tests__/schema-parser-test.ts +++ b/src/language/__tests__/schema-parser-test.ts @@ -1093,6 +1093,13 @@ input Hello { }); }); + it('Directive definition extensions require the experimental flag', () => { + expectToThrowJSON(() => parse('extend directive @foo @bar')).to.deep.equal({ + message: 'Syntax Error: Unexpected Name "directive".', + locations: [{ line: 1, column: 8 }], + }); + }); + it('Directive with incorrect locations', () => { expectSyntaxError( 'directive @foo on FIELD | INCORRECT_LOCATION',