Optimize and improve test coverage for cli/src/config (#13485)

This commit is contained in:
Megha Bansal
2025-11-20 20:57:59 -08:00
committed by GitHub
parent 613b8a4527
commit 61582678bf
17 changed files with 2234 additions and 1872 deletions
@@ -0,0 +1,26 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { SettingPaths } from './settingPaths.js';
describe('SettingPaths', () => {
it('should have the correct structure', () => {
expect(SettingPaths).toEqual({
General: {
PreferredEditor: 'general.preferredEditor',
},
});
});
it('should be immutable', () => {
expect(Object.isFrozen(SettingPaths)).toBe(false); // It's not frozen by default in JS unless Object.freeze is called, but it's `as const` in TS.
// However, we can check if the values are correct.
expect(SettingPaths.General.PreferredEditor).toBe(
'general.preferredEditor',
);
});
});