Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Expecto/Expecto.fs
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,10 @@ module Tests =
let runTestsWithCLIArgs cliArgs args tests =
runTestsWithCLIArgsAndCancel CancellationToken.None cliArgs args tests

/// Runs all given tests.
/// Returns 0 if all tests passed, otherwise 1
let runTests = runTestsWithCLIArgs [] [||]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also document this in the ReadMe


/// Runs tests in this assembly with the supplied command-line options.
/// Returns 0 if all tests passed, otherwise 1
let runTestsInAssemblyWithCLIArgsAndCancel (ct:CancellationToken) cliArgs args =
Expand All @@ -643,3 +647,5 @@ module Tests =
/// Returns 0 if all tests passed, otherwise 1
let runTestsInAssemblyWithCLIArgs cliArgs args =
runTestsInAssemblyWithCLIArgsAndCancel CancellationToken.None cliArgs args


8 changes: 8 additions & 0 deletions Expecto/TestExpecto.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#r "nuget:Expecto"
open Expecto

let simpleTest =
testCase "A simple test" <| fun () ->
Expect.equal 4 (2+2) "2+2 = 4"

runTestsWithCLIArgs [] [||] simpleTest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sporring Could you clarify the motivation of these fsx files?

7 changes: 7 additions & 0 deletions Expecto/TestExpectoFlip.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#r "nuget:Expecto"
open Expecto
open Expecto.Flip
let simpleTest =
(2+2)|>Expect.equal "2+2 = 4" 4

test "" {simpleTest} |> runTestsWithCLIArgs [] [||]