@@ -22,6 +22,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
2222import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider' ;
2323import { Schemas } from 'vs/base/common/network' ;
2424import { IFileService } from 'vs/platform/files/common/files' ;
25+ import { VSBuffer } from 'vs/base/common/buffer' ;
2526
2627suite ( 'ConfigurationService - Node' , ( ) => {
2728
@@ -110,18 +111,18 @@ suite('ConfigurationService - Node', () => {
110111
111112 test ( 'trigger configuration change event when file does not exist' , async ( ) => {
112113 const res = await testFile ( 'config' , 'config.json' ) ;
113-
114- const service = new ConfigurationService ( URI . file ( res . testFile ) , fileService ) ;
114+ const settingsFile = URI . file ( res . testFile ) ;
115+ const service = new ConfigurationService ( settingsFile , fileService ) ;
115116 await service . initialize ( ) ;
116- return new Promise ( ( c , e ) => {
117+ return new Promise ( async ( c , e ) => {
117118 const disposable = Event . filter ( service . onDidChangeConfiguration , e => e . source === ConfigurationTarget . USER ) ( async ( e ) => {
118119 disposable . dispose ( ) ;
119120 assert . equal ( service . getValue ( 'foo' ) , 'bar' ) ;
120121 service . dispose ( ) ;
121122 await res . cleanUp ( ) ;
122123 c ( ) ;
123124 } ) ;
124- fs . writeFileSync ( res . testFile , '{ "foo": "bar" }' ) ;
125+ await fileService . writeFile ( settingsFile , VSBuffer . fromString ( '{ "foo": "bar" }' ) ) ;
125126 } ) ;
126127
127128 } ) ;
0 commit comments