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", [conf.Import("gleam/string", ["join"])]),
// 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, imports: List(Import))
Markdown(filepath: List(String))
}
Constructors
-
IgnoreFiles(filepaths: List(String))filepaths (relative to the
srcdirectory) whose docs should be ignored -
Verboseverbose logging for testament
-
PreserveFilesdon’t delete generated test files after the run
-
ExtraImports(filepath: String, imports: List(Import))other modules to be imported for use in the generated test files
-
Markdown(filepath: List(String))create doc tests from markdown file