Skip to content

Commit aa3a017

Browse files
committed
Passing E2E test for bad PageData type
1 parent bc35c23 commit aa3a017

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

extra/Lamdera/Compile.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ makeDev :: FilePath -> FilePath -> IO ()
7979
makeDev root path = do
8080
debug $ "🏗 lamdera make " <> root <> "/" <> path
8181

82+
absRoot <- Dir.makeAbsolute root
83+
8284
r <- async $
83-
Dir.withCurrentDirectory root $
85+
Dir.withCurrentDirectory absRoot $
8486
Make.run [path] $
8587
Make.Flags
8688
{ _debug = True

test/Test/Ext/ElmPages/Check.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
{-# LANGUAGE OverloadedStrings #-}
2+
13
module Test.Ext.ElmPages.Check where
24

35
import EasyTest
46
import Test.Helpers
57

8+
import Lamdera
9+
import Lamdera.Compile
610

711
all = EasyTest.run suite
812

913

1014
suite :: Test ()
1115
suite = tests $
1216
[ scope "isWireCompatible" $ do
13-
expectEqual 1 1
14-
17+
actual <- catchOutput $
18+
Lamdera.Compile.makeDev "./test/scenario-elm-pages-incompatible-wire/.elm-pages" "Main.elm"
1519

20+
expectTextContains actual
21+
"PageData:\\n\\n- must not contain functions"
1622
]

test/scenario-elm-pages-incompatible-wire/app/Route/Index.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type alias RouteParams =
2525

2626

2727
type alias Data =
28-
{}
28+
{ unserialisableValue : Int -> Int }
2929

3030

3131
route : StatelessRoute RouteParams Data
@@ -39,7 +39,7 @@ route =
3939

4040
data : DataSource Data
4141
data =
42-
DataSource.succeed Data
42+
DataSource.succeed <| Data (\i -> i)
4343

4444

4545
head :

0 commit comments

Comments
 (0)