From 24104749ea432779f5b3ff4073b56a69c615d8a5 Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Fri, 25 Sep 2026 18:57:55 +0000 Subject: [PATCH] test(ingestion): skip optional-grammar suites in callable-alternatives providers test (#3354) Kotlin, Swift and Dart grammars are optional installs. Guard their describe blocks with isLanguageAvailable, as swift.test.ts and dart.test.ts do, so an install without one of them skips instead of failing. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../callable-alternatives-providers.test.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gitnexus/test/integration/resolvers/callable-alternatives-providers.test.ts b/gitnexus/test/integration/resolvers/callable-alternatives-providers.test.ts index b8625f1ef..280a53a22 100644 --- a/gitnexus/test/integration/resolvers/callable-alternatives-providers.test.ts +++ b/gitnexus/test/integration/resolvers/callable-alternatives-providers.test.ts @@ -19,6 +19,14 @@ import { runPipelineFromRepo, type PipelineResult, } from './helpers.js'; +import { isLanguageAvailable } from '../../../src/core/tree-sitter/parser-loader.js'; +import { SupportedLanguages } from '../../../src/config/supported-languages.js'; + +// Kotlin, Swift and Dart grammars are optional installs; skip their suites +// when the grammar did not load, as the per-language resolver suites do. +const kotlinAvailable = isLanguageAvailable(SupportedLanguages.Kotlin); +const swiftAvailable = isLanguageAvailable(SupportedLanguages.Swift); +const dartAvailable = isLanguageAvailable(SupportedLanguages.Dart); const runFixture = (name: string): Promise => runPipelineFromRepo(path.join(FIXTURES, name), () => {}); @@ -71,7 +79,7 @@ describe('Python callable chosen by `or` / `and` / `x if c else y`', () => { }); }); -describe('Kotlin callable chosen by `?:` / `if` expression', () => { +describe.skipIf(!kotlinAvailable)('Kotlin callable chosen by `?:` / `if` expression', () => { let result: PipelineResult; beforeAll(async () => { result = await runFixture('kotlin-callable-alternatives'); @@ -104,7 +112,7 @@ describe('Kotlin callable chosen by `?:` / `if` expression', () => { }); }); -describe('Swift callable chosen by `??` / `?:`', () => { +describe.skipIf(!swiftAvailable)('Swift callable chosen by `??` / `?:`', () => { let result: PipelineResult; beforeAll(async () => { result = await runFixture('swift-callable-alternatives'); @@ -125,7 +133,7 @@ describe('Swift callable chosen by `??` / `?:`', () => { }); }); -describe('Dart callable chosen by `??` / `?:`', () => { +describe.skipIf(!dartAvailable)('Dart callable chosen by `??` / `?:`', () => { let result: PipelineResult; beforeAll(async () => { result = await runFixture('dart-callable-alternatives');