@@ -125,12 +125,35 @@ let suite = describe "A test suite" {
125125 }
126126}
127127
128- runTestSuiteCustom
129- // id is used to order the tests (it blocks)
130- // you can specify a custom ordering function if needed
131- (DefaultRunner(Reporters.ConsoleReporter("v", "x", "?", " "), id))
128+ let run() =
129+ (*
130+ // simple way to run the tests and get the number of failed tests:
131+ describe "System Specs" {
132+ suite // list your suites here
133+ }
134+ |> runTestSuite
135+ |> Async.RunSynchronously
136+ |> Array.filter _.Outcome.IsFailed
137+ |> Array.length
138+ *)
139+
140+ // more control over the test run using a custom reporter
132141 suite
133- |> Async.RunSynchronously
142+ |> runTestSuiteCustom
143+ // id is used to order the tests (it blocks)
144+ // you can specify a custom ordering function if needed
145+ (DefaultRunner(Reporters.ConsoleReporter("v", "x", "?", " "), id))
146+ |> Async.RunSynchronously
147+ |> Array.filter _.Outcome.IsFailed
148+ |> Array.length
149+
150+ #if !INTERACTIVE
151+ // run tests as a console application
152+ [<EntryPoint>]
153+ let main _ = run()
154+ #else
155+ do run() |> ignore
156+ #endif
134157```
135158
136159Output:
@@ -162,6 +185,11 @@ Output:
162185> Tracing works slightly different in ` describe ` blocks due to limitations of me
163186> (most likely) and/or F# computation expressions.
164187
188+ ### ⚙️ Running Tests
189+
190+ - ** ` runTestSuite ` ** - runs a test suite using the default runner and console reporter
191+ - ** ` runTestSuiteCustom ` ** - runs a test suite using a custom runner and reporter
192+
165193---
166194
167195### 🧩 Extending Sprout
0 commit comments