TE

F# Testing

Testing conventions for F# using Expecto or xUnit

F#
Testing
Default

Details

Language / Topic
fsharpF#
Category
Testing

Rules

balanced
- Use `Expecto` with `testList` and `testCase` to define tests as values — compose test suites as plain F# lists.
- Use `Expect.equal`, `Expect.isOk`, and `Expect.throws` from `Expecto.Expect` for clear, typed assertions.
- Organize tests in a separate `*.Tests` project and reference the production project — never mix test code with production code.
- Use `testProperty` with `FsCheck` for property-based testing — generate random inputs to discover edge cases automatically.