diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # Revision history for lsp-test
 
+## 0.5.1.0 -- 2019-04-07
+
+* Add getTypeDefinitions (@fendor) 
+
 ## 0.5.0.2 -- 2018-12-05
 
 * Fix loose threads when exceptions are thrown
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -38,6 +38,11 @@
 For more examples check the [Wiki](https://github.com/bubba/lsp-test/wiki/Introduction)
 
 ## Developing
-To test make sure you have the following language servers installed:
-- [haskell-ide-engine](https://github.com/haskell/haskell-ide-engine)
-- [javascript-typescript-langserver](https://github.com/sourcegraph/javascript-typescript-langserver)
+The tests are integration tests, so make sure you have the following language servers installed and on your PATH:
+### [haskell-ide-engine](https://github.com/haskell/haskell-ide-engine)
+- Check out a relatively recent version of the repo, or see `.travis.yml` to get the exact commit used for CI.
+- `stack install`
+### [javascript-typescript-langserver](https://github.com/sourcegraph/javascript-typescript-langserver)
+`npm i -g javascript-typescript-langserver`
+
+Then run the tests with `stack test` or `cabal new-test`.
diff --git a/lsp-test.cabal b/lsp-test.cabal
--- a/lsp-test.cabal
+++ b/lsp-test.cabal
@@ -1,5 +1,5 @@
 name:                lsp-test
-version:             0.5.0.2
+version:             0.5.1.0
 synopsis:            Functional test framework for LSP servers.
 description:
   A test framework for writing tests against 
@@ -15,13 +15,13 @@
 maintainer:          luke_lau@icloud.com
 stability:           experimental
 bug-reports:         https://github.com/Bubba/haskell-lsp-test/issues
-copyright:           2018 Luke Lau
+copyright:           2019 Luke Lau
 category:            Testing
 build-type:          Simple
 cabal-version:       2.0
 extra-source-files:  README.md
                    , ChangeLog.md
-tested-with:         GHC == 8.2.2 , GHC == 8.4.2 , GHC == 8.4.3
+tested-with:         GHC == 8.2.2 , GHC == 8.4.2 , GHC == 8.4.3, GHC == 8.6.4
 
 source-repository head
   type:     git
diff --git a/src/Language/Haskell/LSP/Test.hs b/src/Language/Haskell/LSP/Test.hs
--- a/src/Language/Haskell/LSP/Test.hs
+++ b/src/Language/Haskell/LSP/Test.hs
@@ -65,6 +65,7 @@
   , getReferences
   -- ** Definitions
   , getDefinitions
+  , getTypeDefinitions
   -- ** Renaming
   , rename
   -- ** Hover
@@ -493,6 +494,14 @@
 getDefinitions doc pos =
   let params = TextDocumentPositionParams doc pos
   in getResponseResult <$> request TextDocumentDefinition params
+
+-- | Returns the type definition(s) for the term at the specified position.
+getTypeDefinitions :: TextDocumentIdentifier -- ^ The document the term is in.
+               -> Position -- ^ The position the term is at.
+               -> Session [Location] -- ^ The location(s) of the definitions
+getTypeDefinitions doc pos =
+  let params = TextDocumentPositionParams doc pos
+  in getResponseResult <$> request TextDocumentTypeDefinition params
 
 -- | Renames the term at the specified position.
 rename :: TextDocumentIdentifier -> Position -> String -> Session ()
diff --git a/src/Language/Haskell/LSP/Test/Decoding.hs b/src/Language/Haskell/LSP/Test/Decoding.hs
--- a/src/Language/Haskell/LSP/Test/Decoding.hs
+++ b/src/Language/Haskell/LSP/Test/Decoding.hs
@@ -13,6 +13,7 @@
 import           Language.Haskell.LSP.Types.Lens
                                          hiding ( error )
 import           Language.Haskell.LSP.Messages
+import           Language.Haskell.LSP.Test.Exceptions
 import qualified Data.HashMap.Strict           as HM
 
 getAllMessages :: Handle -> IO [B.ByteString]
@@ -49,7 +50,7 @@
   let (name, val) = span (/= ':') l
   if null val then return [] else ((name, drop 2 val) :) <$> getHeaders h
   where eofHandler e
-          | isEOFError e = error "Language Server unexpectedly terminated"
+          | isEOFError e = throw UnexpectedServerTermination
           | otherwise = throw e
 
 type RequestMap = HM.HashMap LspId ClientMethod
@@ -71,6 +72,7 @@
     (ReqCompletionItemResolve val) -> insert val acc
     (ReqSignatureHelp val) -> insert val acc
     (ReqDefinition val) -> insert val acc
+    (ReqTypeDefinition val) -> insert val acc
     (ReqFindReferences val) -> insert val acc
     (ReqDocumentHighlights val) -> insert val acc
     (ReqDocumentSymbols val) -> insert val acc
@@ -98,6 +100,7 @@
   CompletionItemResolve         -> RspCompletionItemResolve . decoded
   TextDocumentSignatureHelp     -> RspSignatureHelp . decoded
   TextDocumentDefinition        -> RspDefinition . decoded
+  TextDocumentTypeDefinition    -> RspTypeDefinition . decoded
   TextDocumentReferences        -> RspFindReferences . decoded
   TextDocumentDocumentHighlight -> RspDocumentHighlights . decoded
   TextDocumentDocumentSymbol    -> RspDocumentSymbols . decoded
diff --git a/src/Language/Haskell/LSP/Test/Exceptions.hs b/src/Language/Haskell/LSP/Test/Exceptions.hs
--- a/src/Language/Haskell/LSP/Test/Exceptions.hs
+++ b/src/Language/Haskell/LSP/Test/Exceptions.hs
@@ -17,6 +17,7 @@
                       | UnexpectedDiagnostics
                       | IncorrectApplyEditRequest String
                       | UnexpectedResponseError LspIdRsp ResponseError
+                      | UnexpectedServerTermination
   deriving Eq
 
 instance Exception SessionException
@@ -42,6 +43,7 @@
                                           ++ msgStr
   show (UnexpectedResponseError lid e) = "Received an exepected error in a response for id " ++ show lid ++ ":\n"
                                           ++ show e
+  show UnexpectedServerTermination = "Language server unexpectedly terminated"
 
 -- | A predicate that matches on any 'SessionException'
 anySessionException :: SessionException -> Bool
diff --git a/src/Language/Haskell/LSP/Test/Messages.hs b/src/Language/Haskell/LSP/Test/Messages.hs
--- a/src/Language/Haskell/LSP/Test/Messages.hs
+++ b/src/Language/Haskell/LSP/Test/Messages.hs
@@ -13,6 +13,7 @@
 isServerResponse (RspCompletionItemResolve    _) = True
 isServerResponse (RspSignatureHelp            _) = True
 isServerResponse (RspDefinition               _) = True
+isServerResponse (RspTypeDefinition           _) = True
 isServerResponse (RspFindReferences           _) = True
 isServerResponse (RspDocumentHighlights       _) = True
 isServerResponse (RspDocumentSymbols          _) = True
diff --git a/src/Language/Haskell/LSP/Test/Session.hs b/src/Language/Haskell/LSP/Test/Session.hs
--- a/src/Language/Haskell/LSP/Test/Session.hs
+++ b/src/Language/Haskell/LSP/Test/Session.hs
@@ -201,9 +201,12 @@
   messageChan <- newChan
   initRsp <- newEmptyMVar
 
+  mainThreadId <- myThreadId
+
   let context = SessionContext serverIn absRootDir messageChan reqMap initRsp config caps
       initState = SessionState (IdInt 0) mempty mempty 0 False Nothing
-      launchServerHandler = forkIO $ void $ serverHandler serverOut context
+      launchServerHandler = forkIO $ catch (serverHandler serverOut context)
+                                           (throwTo mainThreadId :: SessionException -> IO ())
   (result, _) <- bracket launchServerHandler killThread $
     const $ runSession context initState session
 
@@ -332,3 +335,4 @@
           | otherwise       = Cyan
 
         showPretty = B.unpack . encodePretty
+
diff --git a/test/Test.hs b/test/Test.hs
--- a/test/Test.hs
+++ b/test/Test.hs
@@ -259,6 +259,13 @@
       defs <- getDefinitions doc pos
       liftIO $ defs `shouldBe` [Location (doc ^. uri) (mkRange 28 0 28 7)]
 
+  -- describe "getTypeDefinitions" $
+  --   it "works" $ runSession "hie" fullCaps "test/data/renamePass" $ do
+  --     doc <- openDoc "Desktop/simple.hs" "haskell"
+  --     let pos = Position 20 23  -- Quit value
+  --     defs <- getTypeDefinitions doc pos
+  --     liftIO $ defs `shouldBe` [Location (doc ^. uri) (mkRange 10 5 10 12)]  -- Type definition
+
   describe "waitForDiagnosticsSource" $
     it "works" $ runSession "hie" fullCaps "test/data" $ do
       openDoc "Error.hs" "haskell"
