Skip to content

Commit c96b5d9

Browse files
committed
fix: update Readme, modify out.png, and adjust sample.fsx
1 parent d0aec10 commit c96b5d9

File tree

3 files changed

+61
-10
lines changed

3 files changed

+61
-10
lines changed

Readme.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

136159
Output:
@@ -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

out.png

-6.84 KB
Loading

sample.fsx

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,32 @@ let suite = describe "A test suite" {
6969
}
7070
}
7171

72-
runTestSuiteCustom
73-
// id is used to order the tests (it blocks)
74-
// you can specify a custom ordering function if needed
75-
(DefaultRunner(Reporters.ConsoleReporter("v", "x", "?", " "), id))
72+
let run() =
73+
(*
74+
// simple way to run the tests and get the number of failed tests:
75+
describe "System Specs" {
76+
suite // list your suites here
77+
}
78+
|> runTestSuite
79+
|> Async.RunSynchronously
80+
|> Array.filter _.Outcome.IsFailed
81+
|> Array.length
82+
*)
83+
84+
// more control over the test run using a custom reporter
7685
suite
77-
|> Async.RunSynchronously
86+
|> runTestSuiteCustom
87+
// id is used to order the tests (it blocks)
88+
// you can specify a custom ordering function if needed
89+
(DefaultRunner(Reporters.ConsoleReporter("v", "x", "?", " "), id))
90+
|> Async.RunSynchronously
91+
|> Array.filter _.Outcome.IsFailed
92+
|> Array.length
93+
94+
#if !INTERACTIVE
95+
// run tests as a console application
96+
[<EntryPoint>]
97+
let main _ = run()
98+
#else
99+
do run() |> ignore
100+
#endif

0 commit comments

Comments
 (0)