Add ignoreLogNotifications config option
[lsp-test.git] / test / Test.hs
index 342d889f464d73ce9435c56148bc428c5a7844ae..dc770d9205efc21e22147660380470316ed371a1 100644 (file)
@@ -91,7 +91,9 @@ main = hspec $ do
                 getDocumentSymbols doc
                 -- should now timeout
                 skipManyTill anyMessage message :: Session ApplyWorkspaceEditRequest
-        in sesh `shouldThrow` (== Timeout)
+            isTimeout (Timeout _) = True
+            isTimeout _ = False
+        in sesh `shouldThrow` isTimeout
 
 
     describe "SessionException" $ do
@@ -331,6 +333,12 @@ main = hspec $ do
           pred _ = False
       void $ satisfy pred
 
+  describe "ignoreLogNotifications" $
+    it "works" $
+      runSessionWithConfig (defaultConfig { ignoreLogNotifications = True }) "hie"  fullCaps "test/data" $ do
+        openDoc "Format.hs" "haskell"
+        void publishDiagnosticsNotification
+
 mkRange sl sc el ec = Range (Position sl sc) (Position el ec)
 
 didChangeCaps :: ClientCapabilities