33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55import * as assert from 'assert' ;
6- import { Config , ConfigKey } from '../../../platform/configuration/common/configurationService' ;
6+ import { BaseConfig , Config , ConfigKey , ConfigValueValidators } from '../../../platform/configuration/common/configurationService' ;
77import { ConfigurationServiceImpl } from '../../../platform/configuration/vscode/configurationServiceImpl' ;
8- import { Event } from '../../../util/vs/base/common/event' ;
98import { NullEnvService } from '../../../platform/env/common/nullEnvService' ;
9+ import { Event } from '../../../util/vs/base/common/event' ;
10+
11+ class TestConfigurationServiceImpl extends ConfigurationServiceImpl {
12+
13+ public getDefinedDefaultValue < T > ( key : BaseConfig < T > ) : T {
14+ if ( ConfigValueValidators . isCustomInternalDefaultValue ( key . defaultValue ) || ConfigValueValidators . isCustomTeamDefaultValue ( key . defaultValue ) ) {
15+ return this . getDefaultValue ( key ) ;
16+ }
17+ return key . defaultValue ;
18+ }
19+
20+ }
1021
1122suite ( 'Configuration Defaults' , ( ) => {
1223
13- let testObject : ConfigurationServiceImpl ;
24+ let testObject : TestConfigurationServiceImpl ;
1425
1526 setup ( ( ) => {
16- testObject = new ConfigurationServiceImpl ( {
27+ testObject = new TestConfigurationServiceImpl ( {
1728 _serviceBrand : undefined ,
1829 copilotToken : undefined ,
1930 onDidStoreUpdate : Event . None
@@ -27,7 +38,7 @@ suite('Configuration Defaults', () => {
2738
2839 for ( const setting of advancedSettings ) {
2940 const actual = testObject . getConfig < unknown > ( setting ) ;
30- const expected = testObject . getDefaultValue ( setting ) ;
41+ const expected = testObject . getDefinedDefaultValue ( setting ) ;
3142 assert . deepStrictEqual ( actual , expected , `Default value for ${ setting . fullyQualifiedId } did not match` ) ;
3243 }
3344
@@ -38,7 +49,7 @@ suite('Configuration Defaults', () => {
3849
3950 for ( const setting of internalSettings ) {
4051 const actual = testObject . getConfig < unknown > ( setting ) ;
41- const expected = testObject . getDefaultValue ( setting ) ;
52+ const expected = testObject . getDefinedDefaultValue ( setting ) ;
4253 assert . deepStrictEqual ( actual , expected , `Default value for ${ setting . fullyQualifiedId } did not match` ) ;
4354 }
4455 } ) ;
0 commit comments