File tree 4 files changed +10
-6
lines changed
4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -764,7 +764,6 @@ mkRunEnv runArgs { dependencies, purs } = do
764
764
runOptions =
765
765
{ moduleName
766
766
, execArgs
767
- , sourceDir: Paths .cwd
768
767
, executeDir: Paths .cwd
769
768
, successMessage: Nothing
770
769
, failureMessage: " Running failed."
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ type RunEnv a =
38
38
type RunOptions =
39
39
{ execArgs :: Array String
40
40
, moduleName :: String
41
- , sourceDir :: FilePath
42
41
, executeDir :: FilePath
43
42
, successMessage :: Maybe String
44
43
, failureMessage :: String
@@ -75,6 +74,7 @@ run = do
75
74
logDebug " Running with backend: nodejs"
76
75
let runDir = Path .concat [ Paths .localCachePath, " run" ]
77
76
FS .mkdirp runDir
77
+ absOutput <- liftEffect $ Path .resolve [] $ fromMaybe " output" workspace.buildOptions.output
78
78
let
79
79
runJsPath = Path .concat [ runDir, " run.js" ]
80
80
packageJsonPath = Path .concat [ runDir, " package.json" ]
@@ -85,9 +85,7 @@ run = do
85
85
nodeContents =
86
86
Array .fold
87
87
[ " import { main } from 'file://"
88
- , withForwardSlashes opts.sourceDir
89
- , " /"
90
- , fromMaybe " output" workspace.buildOptions.output
88
+ , withForwardSlashes absOutput
91
89
, " /"
92
90
, opts.moduleName
93
91
, " /"
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ run = do
37
37
{ successMessage: Just $ " Test succeeded for package \" " <> PackageName .print name <> " \" ."
38
38
, failureMessage: " Tests failed for package \" " <> PackageName .print name <> " \" ."
39
39
, executeDir: Paths .cwd
40
- , sourceDir: Paths .cwd
41
40
, execArgs
42
41
, moduleName
43
42
}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import Spago.Command.Init (DefaultConfigOptions(..))
12
12
import Spago.Command.Init as Init
13
13
import Spago.Core.Config as Config
14
14
import Spago.FS as FS
15
+ import Spago.Paths (paths )
15
16
import Test.Spec (Spec )
16
17
import Test.Spec as Spec
17
18
import Test.Spec.Assertions as Assert
@@ -25,6 +26,13 @@ spec = Spec.around withTempDir do
25
26
spago [ " build" ] >>= shouldBeSuccess
26
27
spago [ " test" ] >>= shouldBeSuccessOutputWithErr (fixture " test-output-stdout.txt" ) (fixture " test-output-stderr.txt" )
27
28
29
+ Spec .it " tests successfully when using a different output dir" \{ spago, fixture } -> do
30
+ spago [ " init" , " --name" , " 7368613235362d6a336156536c675a7033334e7659556c6d38" ] >>= shouldBeSuccess
31
+
32
+ let tempDir = Path .concat [ paths.temp, " output" ]
33
+ spago [ " build" , " --output" , tempDir ] >>= shouldBeSuccess
34
+ spago [ " test" , " --output" , tempDir ] >>= shouldBeSuccessOutputWithErr (fixture " test-output-stdout.txt" ) (fixture " test-output-stderr.txt" )
35
+
28
36
Spec .it " fails nicely when the test module is not found" \{ spago, fixture } -> do
29
37
spago [ " init" , " --name" , " 7368613235362d6a336156536c675a7033334e7659556c6d38" ] >>= shouldBeSuccess
30
38
spago [ " build" ] >>= shouldBeSuccess
You can’t perform that action at this time.
0 commit comments