From d60b3771ca4ee6eb8e4fad50a130a779911e05ea Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Wed, 22 Apr 2026 17:44:19 +0100 Subject: [PATCH] fix(tests): update registry-primary-flag test for C# migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "returns exactly the flipped languages" case expected `enabled.size === 1` after toggling Python off and Go on. After the C# migration lands C# in MIGRATED_LANGUAGES, C# is default-on too — so the size is now 2 (Go + C#) unless C# is also opted out. Turn off C# alongside Python in the test setup. Added a comment noting that future migrations must add their REGISTRY_PRIMARY_='false' line here. --- gitnexus/test/unit/registry-primary-flag.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gitnexus/test/unit/registry-primary-flag.test.ts b/gitnexus/test/unit/registry-primary-flag.test.ts index 759114af5..7e428e031 100644 --- a/gitnexus/test/unit/registry-primary-flag.test.ts +++ b/gitnexus/test/unit/registry-primary-flag.test.ts @@ -148,15 +148,20 @@ describe('primaryLanguages', () => { }); it('returns exactly the flipped languages (env opts in unmigrated, opts out migrated)', () => { - // Python is migrated (default-on), explicitly off via env var. - // Go and Java are unmigrated (default-off); Go opted in, Java left off. + // Python and C# are migrated (default-on); both explicitly off via + // env vars. Go and Java are unmigrated (default-off); Go opted in, + // Java left off. This pins the semantics across all + // MIGRATED_LANGUAGES — as languages migrate, add their + // `REGISTRY_PRIMARY_ = 'false'` line here alongside Python / C#. process.env['REGISTRY_PRIMARY_PYTHON'] = 'false'; + process.env['REGISTRY_PRIMARY_CSHARP'] = 'false'; process.env['REGISTRY_PRIMARY_GO'] = '1'; const enabled = primaryLanguages(); expect(enabled.has(SupportedLanguages.Python)).toBe(false); + expect(enabled.has(SupportedLanguages.CSharp)).toBe(false); expect(enabled.has(SupportedLanguages.Go)).toBe(true); expect(enabled.has(SupportedLanguages.Java)).toBe(false); - // Only Go is on: migrated-default-Python overridden off, Go explicitly on. + // Only Go is on: migrated defaults overridden off, Go explicitly on. expect(enabled.size).toBe(1); });