Skip to content

Commit

Permalink
run tests with --no-restore; instead of building the tests, just buil…
Browse files Browse the repository at this point in the history
…d the full solution before running test targets
  • Loading branch information
Larocceau committed Nov 29, 2024
1 parent d91c3bb commit 2d70f05
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Content/default/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,27 @@ Target.create "Azure" (fun _ ->

deployment |> Deploy.execute "SAFE-App" Deploy.NoParameters |> ignore)

Target.create "Run" (fun _ ->
run dotnet [ "restore"; "Application.sln" ] "."
run dotnet [ "build" ] sharedPath
Target.create "Build" (fun _ ->
run dotnet [ "build"; "Application.sln" ] "."

)

Target.create "Run" (fun _ ->
[
"server", dotnet [ "watch"; "run"; "--no-restore" ] serverPath
"client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] clientPath
]
|> runParallel)

let buildSharedTests () = run dotnet [ "build" ] sharedTestsPath

Target.create "RunTestsHeadless" (fun _ ->
buildSharedTests ()

run dotnet [ "run" ] serverTestsPath
run dotnet [ "fable"; "-o"; "output" ] clientTestsPath
run npx [ "mocha"; "output" ] clientTestsPath
)

Target.create "WatchRunTests" (fun _ ->
buildSharedTests ()

[
"server", dotnet [ "watch"; "run" ] serverTestsPath
"server", dotnet [ "watch"; "run"; "--no-restore" ] serverTestsPath
"client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] clientTestsPath
]
|> runParallel)
Expand All @@ -78,6 +74,10 @@ Target.create "Format" (fun _ -> run dotnet [ "fantomas"; "." ] ".")
open Fake.Core.TargetOperators

let dependencies = [
"Build" ==> "RunTestsHeadless"
"Build" ==> "WatchRunTests"
"Build" ==> "Run"

"Clean" ==> "RestoreClientDependencies" ==> "Bundle" ==> "Azure"

"Clean" ==> "RestoreClientDependencies" ==> "Run"
Expand Down

0 comments on commit 2d70f05

Please sign in to comment.