@@ -10,14 +10,15 @@ export class ClientOptionsLoader implements IClientOptionsLoader {
1010 ) { }
1111
1212 async load ( ) : Promise < ClientOptions > {
13- let { serverPort } = await this . storedOptionsLoader . load ( )
13+ let { serverPort, enableNotifications } = await this . storedOptionsLoader . load ( )
1414 const extensionId = this . manifestInfo . getId ( )
1515 let serverUrl = new URL ( `http://localhost:${ serverPort } /` )
1616 let { host } = new URL ( `extension://${ extensionId } .localhost` )
1717
1818 return {
1919 serverUrl,
2020 clientHostName : host ,
21+ enableNotifications,
2122 }
2223 }
2324}
@@ -27,13 +28,19 @@ if (import.meta.vitest) {
2728
2829 describe ( ClientOptionsLoader , ( ) => {
2930 it ( "should build a ClientOption from storage and manifest info correctly" , async ( ) => {
30- const storedOptionsLoader = { load : vi . fn ( ) . mockResolvedValue ( { serverPort : 1234 } ) }
31+ const storedOptionsLoader = {
32+ load : vi . fn ( ) . mockResolvedValue ( {
33+ serverPort : 1234 ,
34+ enableNotifications : true ,
35+ } ) ,
36+ }
3137 const manifestInfo = { getId : vi . fn ( ) . mockReturnValue ( "@test.extension" ) }
3238 const sut = new ClientOptionsLoader ( storedOptionsLoader , manifestInfo )
3339
3440 await expect ( sut . load ( ) ) . resolves . deep . equals ( {
3541 serverUrl : new URL ( "http://localhost:1234/" ) ,
3642 clientHostName : "test.extension.localhost" ,
43+ enableNotifications : true ,
3744 } )
3845 } )
3946 } )
0 commit comments