1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Ensure we can't look up baz from side effect imports

This commit is contained in:
joshvera 2018-11-13 12:06:22 -05:00
parent 4fed5eb1e7
commit 71a73150c9

View File

@ -50,6 +50,14 @@ spec config = parallel $ do
closure' valueRef `shouldBe` Right (Closure (PackageInfo { packageName = "analysis", packageResolutions = mempty }) (ModuleInfo "a.ts") "baz" [] (Right ()) ())
other -> expectationFailure (show other)
it "side effect only imports dont expose exports" $ do
(_, res) <- evaluate ["main3.ts", "a.ts"]
case ModuleTable.lookup "main3.ts" <$> res of
Right (Just (Module _ (scopeGraph, (heap, valueRef)) :| [])) -> do
fmap (const ()) <$> ScopeGraph.lookupScopePath "baz" scopeGraph `shouldBe` Nothing
valueRef `shouldBe` Rval Unit
other -> expectationFailure (show other)
it "side effect only imports" $ do
(_, res) <- evaluate ["main2.ts", "a.ts", "foo.ts"]
case ModuleTable.lookup "main2.ts" <$> res of