Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 2.09 KB

File metadata and controls

46 lines (36 loc) · 2.09 KB

Scriptorium

F# libraries for building and testing F#/Fable applications.

Packages

Package Description NuGet
Scriptorium.Ink ANSI colour and style for terminal output NuGet
Scriptorium.Parchment Structured logging (info, warn, error) NuGet
Scriptorium.Nib Fluent assertion library NuGet
Scriptorium.Quill Test runner with coloured output and source links NuGet
Scriptorium.Nib.Snapshot Snapshot assertions for Nib NuGet
Scriptorium.Nib.Browser Browser tests via Playwright NuGet
Scriptorium.Hedgehog Property-based testing (Hedgehog integration) NuGet

Quick start

open Scriptorium.Nib
open Scriptorium.Quill.Runner
open type Scriptorium.Quill.Runner.Test

[<EntryPoint>]
let main _ =
    runTests [
        testList "My suite" [

            test("equality", fun () ->
                assertThat 42 (isEqualTo 42)
            )

            test("option chain", fun () ->
                assertThat (Some "hello") (Option.value >> isEqualTo "hello")
            )

            test("record fields with tags", fun () ->
                assertThat { Name = "alice"; Age = 25 } (
                    inside _.Age  (tag "age"  >> isGreaterOrEqual 18)
                    >> inside _.Name (tag "name" >> isNotEqualTo "")
                )
            )

        ]
    ]