@@ -1714,6 +1714,18 @@ suite('Server activation', () => {
17141714 await client . stop ( ) ;
17151715 } ) ;
17161716
1717+ test ( 'Start server fails on request when stopped once' , async ( ) => {
1718+ const client = createClient ( ) ;
1719+ assert . strictEqual ( client . state , lsclient . State . Stopped ) ;
1720+ const result : number = await client . sendRequest ( 'request' , { value : 10 } ) ;
1721+ assert . strictEqual ( client . state , lsclient . State . Running ) ;
1722+ assert . strictEqual ( result , 11 ) ;
1723+ await client . stop ( ) ;
1724+ await assert . rejects ( async ( ) => {
1725+ await client . sendRequest ( 'request' , { value : 10 } ) ;
1726+ } , / C l i e n t i s n o t r u n n i n g / ) ;
1727+ } ) ;
1728+
17171729 test ( 'Start server on notification' , async ( ) => {
17181730 const client = createClient ( ) ;
17191731 assert . strictEqual ( client . state , lsclient . State . Stopped ) ;
@@ -1722,6 +1734,17 @@ suite('Server activation', () => {
17221734 await client . stop ( ) ;
17231735 } ) ;
17241736
1737+ test ( 'Start server fails on notification when stopped once' , async ( ) => {
1738+ const client = createClient ( ) ;
1739+ assert . strictEqual ( client . state , lsclient . State . Stopped ) ;
1740+ await client . sendNotification ( 'notification' ) ;
1741+ assert . strictEqual ( client . state , lsclient . State . Running ) ;
1742+ await client . stop ( ) ;
1743+ await assert . rejects ( async ( ) => {
1744+ await client . sendNotification ( 'notification' ) ;
1745+ } , / C l i e n t i s n o t r u n n i n g / ) ;
1746+ } ) ;
1747+
17251748 test ( 'Add pending request handler' , async ( ) => {
17261749 const client = createClient ( ) ;
17271750 assert . strictEqual ( client . state , lsclient . State . Stopped ) ;
0 commit comments