Skip to content

Getting Started

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

Required:

If needed:

  • Node.js
  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.js
    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
    # JavaScript
    dotnet fable --runScript
    # .NET
    dotnet run

    You should see output like this:

    Example test output