Testify is a beginner-friendly F# testing library built around quotations, reusable expectations, and property-style checks with readable failure output.
Warning
Testify and these docs are still under active development. Treat the current public surface as the intended direction, not as a claim that every edge case is already fully verified and battle-tested.
The public API is intentionally split into:
Assertfor one quoted expression right nowAssertExpectationfor reusable example-based semanticsCheckfor generated property checks against a reference implementationCheckExpectationfor reusable property relationsAssertOperatorsandCheckOperatorsfor concise fail-fast DSL syntax
Testify now ships with a local FsDocs site in site-docs/.
From the repository root:
.\build-docs.ps1That will:
- restore the pinned local FsDocs tool
- build the library and XML documentation
- verify the main API-doc coverage rules
- generate the site into
output/docs/
For local live preview:
.\watch-docs.ps1From the repository root:
dotnet build .\src\Testify\Testify.fsproj --no-restore
dotnet test .\tests\Testify.ApiTests\Testify.ApiTests.fsproj --no-build --no-restore
dotnet build .\samples\Testify.Expecto.Sample\Testify.Expecto.Sample.fsproj --no-restorenamespace Demo
open Microsoft.VisualStudio.TestTools.UnitTesting
open Testify
open Testify.MSTest
open Testify.AssertOperators
open Testify.CheckOperators
module Math =
let add x y = x + y
[<TestifyClass>]
type DemoTests() =
[<TestifyMethod>]
member _.``example assertion`` () =
<@ Math.add 1 2 @> =? 3
[<TestifyMethod>]
member _.``example property`` () =
<@ List.rev >> List.rev @> |=> id- Read the generated site landing page under
output/docs/after running.\build-docs.ps1 - Use
Assert.shouldor=?for direct examples - Use
Assert.resultwhen you want to inspect or render failures yourself - Use
Check.shouldor|=>for fail-fast property checks against a trusted reference - Use
Check.resultwhen you want a structuredCheckResult - Reach for
Check.resultBy/Check.shouldBywhen you need nested or dependentFsCheckquantification