Skip to content

Getting Started

This guide walks you through installing Scriptorium.Quill and Scriptorium.Nib, writing your first test, and running it.

Required:

Depending on the target you run:

  • Node.js — for the JavaScript and TypeScript targets
  • Python 3 with fable-library installed
  1. Create a test project

    Terminal window
    dotnet new console -lang F# -n YourProjectName
    cd YourProjectName
  2. Add the packages

    Terminal window
    dotnet add package Scriptorium.Quill
    dotnet add package Scriptorium.Nib
  3. Write your first test

    Program.fs
    module YourProjectName.Main
    open Scriptorium.Nib.Assertion
    open type Scriptorium.Quill.Test
    open type Scriptorium.Quill.Runner
    [<EntryPoint>]
    let main _ =
    runTests [
    testList ("Calculator", [
    test ("add returns the sum", fun _ ->
    assertThat (1 + 1) (isEqualTo 2)
    )
    test ("multiple assertions can be chained", fun _ ->
    assertThat 42 (
    isGreaterThan 0
    >> isLessThan 100
    >> isNotEqualTo 0
    )
    )
    ])
    ]
  4. Finally run the tests

    Terminal window
    # .NET
    dotnet run
    # JavaScript
    dotnet fable --runScript
    # TypeScript
    dotnet fable --lang typescript -o build-ts --run npx tsx build-ts/Program.ts
    # Python (needs fable-library in the environment)
    dotnet fable --lang python -o build-py --run uv run --frozen python build-py/program.py

    The same test suite runs unchanged on every target.

    You should see output like this:

    Example test output