testament/conf

Testament config

Example

import gleeunit
import testament
import testament/conf

pub fn main() -> Nil {
 testament.test_main_with_opts(gleeunit.main, [
  // ignore any doc tests in `src/ignored.gleam`
  conf.IgnoreFiles(["src/ignored.gleam"]),
  // add import `gleam/string` into tests for `src/string_util.gleam`
  conf.ExtraImports("src/string_util.gleam", ["gleam/string"]),
  // generate doc tests for gleam snippets in `docs/docs.md`
  conf.Markdown(["docs/docs.md"]),
 ])
}

Types

Options to change how testament works

pub type Conf {
  IgnoreFiles(filepaths: List(String))
  Verbose
  PreserveFiles
  ExtraImports(filepath: String, modules: List(String))
  Markdown(filepath: List(String))
}

Constructors

  • IgnoreFiles(filepaths: List(String))

    filepaths (relative to the src directory) whose docs should be ignored

  • Verbose

    verbose logging for testament

  • PreserveFiles

    don’t delete generated test files after the run

  • ExtraImports(filepath: String, modules: List(String))

    other modules to be imported for use in the generated test files

  • Markdown(filepath: List(String))

    create doc tests from markdown file

Search Document