@@ -62,6 +62,27 @@ suite('DefaultConfiguration', () => {
62
62
assert . deepStrictEqual ( actual . getValue ( 'test.configurationDefaultsOverride' ) , 'overrideValue' ) ;
63
63
} ) ;
64
64
65
+ test ( 'configuration default overrides are read from cache when model is read before initialize' , async ( ) => {
66
+ await configurationCache . write ( cacheKey , JSON . stringify ( { 'test.configurationDefaultsOverride' : 'overrideValue' } ) ) ;
67
+ const testObject = new DefaultConfiguration ( configurationCache , TestEnvironmentService ) ;
68
+
69
+ assert . deepStrictEqual ( testObject . configurationModel . getValue ( 'test.configurationDefaultsOverride' ) , 'defaultValue' ) ;
70
+
71
+ const actual = await testObject . initialize ( ) ;
72
+
73
+ assert . deepStrictEqual ( actual . getValue ( 'test.configurationDefaultsOverride' ) , 'overrideValue' ) ;
74
+ assert . deepStrictEqual ( testObject . configurationModel . getValue ( 'test.configurationDefaultsOverride' ) , 'overrideValue' ) ;
75
+ } ) ;
76
+
77
+ test ( 'configuration default overrides are read from cache' , async ( ) => {
78
+ await configurationCache . write ( cacheKey , JSON . stringify ( { 'test.configurationDefaultsOverride' : 'overrideValue' } ) ) ;
79
+ const testObject = new DefaultConfiguration ( configurationCache , TestEnvironmentService ) ;
80
+
81
+ const actual = await testObject . initialize ( ) ;
82
+
83
+ assert . deepStrictEqual ( actual . getValue ( 'test.configurationDefaultsOverride' ) , 'overrideValue' ) ;
84
+ } ) ;
85
+
65
86
test ( 'configuration default overrides read from cache override environment' , async ( ) => {
66
87
const environmentService = new BrowserWorkbenchEnvironmentService ( { logsPath : joinPath ( URI . file ( 'tests' ) . with ( { scheme : 'vscode-tests' } ) , 'logs' ) , workspaceId : '' , configurationDefaults : { 'test.configurationDefaultsOverride' : 'envOverrideValue' } } , TestProductService ) ;
67
88
await configurationCache . write ( cacheKey , JSON . stringify ( { 'test.configurationDefaultsOverride' : 'overrideValue' } ) ) ;
0 commit comments