@@ -10,14 +10,19 @@ import {
1010 register : jest . fn ( ) ,
1111 } ,
1212 workspace : {
13- showInformativeMessage : jest . fn ( ) ,
1413 showErrorMessage ( err : unknown ) {
1514 throw err ;
1615 } ,
1716 openFile : jest . fn ( ) ,
1817 } ,
18+ notifications : {
19+ add : jest . fn ( ) ,
20+ } ,
1921} ) ;
2022
23+ class NotificationRequestMock { }
24+ ( global as any ) . NotificationRequest = NotificationRequestMock ;
25+
2126class CompositeDisposableMock implements Disposable {
2227 private _disposables : Array < Disposable > = [ ] ;
2328 add ( disposable : Disposable ) {
@@ -57,7 +62,7 @@ beforeEach(() => {
5762 ( nova . commands . register as jest . Mock )
5863 . mockReset ( )
5964 . mockReturnValue ( { dispose : jest . fn ( ) } ) ;
60- ( nova . workspace . showInformativeMessage as jest . Mock ) . mockReset ( ) ;
65+ ( nova . notifications . add as jest . Mock ) . mockReset ( ) ;
6166 ( nova . workspace . openFile as jest . Mock ) . mockReset ( ) ;
6267} ) ;
6368
@@ -104,7 +109,7 @@ describe("Symbol search results tree", () => {
104109 visible : false ,
105110 } ) ) ;
106111 createSymbolSearchResultsTree ( symbols ) ;
107- expect ( nova . workspace . showInformativeMessage ) . toHaveBeenCalledTimes ( 1 ) ;
112+ expect ( nova . notifications . add ) . toHaveBeenCalledTimes ( 1 ) ;
108113 } ) ;
109114
110115 it ( "registers a double click command to open each search result" , async ( ) => {
@@ -279,7 +284,7 @@ it.each([
279284 visible : false ,
280285 } ) ) ;
281286 create ( ) ;
282- expect ( nova . workspace . showInformativeMessage ) . toHaveBeenCalledTimes ( 1 ) ;
287+ expect ( nova . notifications . add ) . toHaveBeenCalledTimes ( 1 ) ;
283288} ) ;
284289
285290it . each ( [
@@ -306,7 +311,7 @@ it.each([
306311 "apexskier.typescript.sidebar.symbols" ,
307312 expect . anything ( )
308313 ) ;
309- expect ( nova . workspace . showInformativeMessage ) . not . toBeCalled ( ) ;
314+ expect ( nova . notifications . add ) . not . toBeCalled ( ) ;
310315 const treeMock1 = TreeViewTypedMock . mock . results [ 0 ] . value ;
311316 expect ( treeMock1 . dispose ) . not . toBeCalled ( ) ;
312317 expect ( nova . commands . register ) . toBeCalledWith (
0 commit comments