Replace rename test while HaRe is gone
authorLuke Lau <luke_lau@icloud.com>
Fri, 20 Dec 2019 00:57:46 +0000 (00:57 +0000)
committerLuke Lau <luke_lau@icloud.com>
Fri, 20 Dec 2019 00:57:46 +0000 (00:57 +0000)
test/Test.hs

index ed8c6b5f5f0c6ce0e8d2b88fd8bbe40bcf0f7efb..eff7404f0822ae6463467bc6308e5d5a9b92651c 100644 (file)
@@ -283,11 +283,18 @@ main = hspec $ do
         diag ^. severity `shouldBe` Just DsError
         diag ^. source `shouldBe` Just "bios"
 
-  describe "rename" $
-    it "works" $ runSession "hie" fullCaps "test/data" $ do
-      doc <- openDoc "Rename.hs" "haskell"
-      rename doc (Position 1 0) "bar"
-      documentContents doc >>= liftIO . shouldBe "main = bar\nbar = return 42\n"
+  describe "rename" $ do
+    it "works" $ pendingWith "HaRe not in hie-bios yet"
+    it "works on javascript" $
+      runSession "javascript-typescript-stdio" fullCaps "test/data/javascriptPass" $ do
+        doc <- openDoc "test.js" "javascript"
+        rename doc (Position 2 11) "bar"
+        documentContents doc >>= liftIO . (`shouldContain` "function bar()") . T.unpack
+
+    -- runSession "hie" fullCaps "test/data" $ do
+    --   doc <- openDoc "Rename.hs" "haskell"
+    --   rename doc (Position 1 0) "bar"
+    --   documentContents doc >>= liftIO . shouldBe "main = bar\nbar = return 42\n"
 
   describe "getHover" $
     it "works" $ runSession "hie" fullCaps "test/data/renamePass" $ do