Skip to content

Commit

Permalink
Fix compiler warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
theimowski committed Aug 10, 2018
1 parent 2560024 commit cd51107
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 46 deletions.
10 changes: 5 additions & 5 deletions tests/Main.fs
Expand Up @@ -2,11 +2,11 @@ module ExpectoTemplate
open Expecto

let config =
{ defaultConfig with
// Disabling parallel run due to yarn concurrency issue when
// installing packages in parallel
// https://github.com/yarnpkg/yarn/issues/2629
parallel = false }
{ defaultConfig with
// Disabling parallel run due to yarn concurrency issue when
// installing packages in parallel
// https://github.com/yarnpkg/yarn/issues/2629
parallel = false }

[<EntryPoint>]
let main argv =
Expand Down
86 changes: 45 additions & 41 deletions tests/Tests.fs
Expand Up @@ -54,32 +54,36 @@ type TemplateArgs =
|> List.choose id
|> String.concat " "

let serverGen = Gen.elements [
None
Some "giraffe"
Some "suave"
]

let deployGen = Gen.elements [
None
Some "docker"
Some "azure"
]

let layoutGen = Gen.elements [
None
Some "fulma-basic"
Some "fulma-admin"
Some "fulma-cover"
Some "fulma-hero"
Some "fulma-landing"
Some "fulma-login"
]

let jsDepsGen = Gen.elements [
None
Some "npm"
]
let serverGen =
Gen.elements [
None
Some "giraffe"
Some "suave"
]

let deployGen =
Gen.elements [
None
Some "docker"
Some "azure"
]

let layoutGen =
Gen.elements [
None
Some "fulma-basic"
Some "fulma-admin"
Some "fulma-cover"
Some "fulma-hero"
Some "fulma-landing"
Some "fulma-login"
]

let jsDepsGen =
Gen.elements [
None
Some "npm"
]

type TemplateArgsArb () =
static member Arb () : Arbitrary<TemplateArgs> =
Expand Down Expand Up @@ -136,22 +140,22 @@ let fsCheckConfig =

[<Tests>]
let tests =
testList "Project created from template" [
testPropertyWithConfig fsCheckConfig "Project should build properly" (fun (x : TemplateArgs) ->
let newSAFEArgs = x.ToString()
let uid = Guid.NewGuid().ToString("n")
let dir = Path.GetTempPath() </> uid
Directory.create dir
testList "Project created from template" [
testPropertyWithConfig fsCheckConfig "Project should build properly" (fun (x : TemplateArgs) ->
let newSAFEArgs = x.ToString()
let uid = Guid.NewGuid().ToString("n")
let dir = Path.GetTempPath() </> uid
Directory.create dir

run dotnet (sprintf "new SAFE %s" newSAFEArgs) dir
run dotnet (sprintf "new SAFE %s" newSAFEArgs) dir

Expect.isTrue (File.exists (dir </> "paket.lock")) (sprintf "paket.lock not present for '%s'" newSAFEArgs)
Expect.isTrue (File.exists (dir </> "paket.lock")) (sprintf "paket.lock not present for '%s'" newSAFEArgs)

run fake "build" dir
run fake "build" dir

logger.info(
eventX "Deleting `{dir}`"
>> setField "dir" dir)
Directory.delete dir
)
]
logger.info(
eventX "Deleting `{dir}`"
>> setField "dir" dir)
Directory.delete dir
)
]

0 comments on commit cd51107

Please sign in to comment.