fix(tests): update registry-primary-flag test for C# migration

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_<LANG>='false'
line here.
This commit is contained in:
Gergo Magyar 2026-04-22 17:44:19 +01:00
parent 4aaf0db598
commit d60b3771ca

View file

@ -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_<LANG> = '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);
});