startest/locator

Types

A file that contains tests.

pub type TestFile {
  TestFile(
    module_name: String,
    filepath: String,
    tests: List(test_tree.TestTree),
    collect_duration: duration.Duration,
  )
}

Constructors

  • TestFile(
      module_name: String,
      filepath: String,
      tests: List(test_tree.TestTree),
      collect_duration: duration.Duration,
    )

    Arguments

    module_name

    The name of the Gleam module.

    filepath

    The filepath to the .gleam file.

    tests

    The list of tests in the file.

    collect_duration

    The time it took to collect the tests in the file.

pub type TestFunction {
  TestFunction(
    module_name: String,
    name: String,
    body: fn() -> dynamic.Dynamic,
  )
}

Constructors

  • TestFunction(
      module_name: String,
      name: String,
      body: fn() -> dynamic.Dynamic,
    )

A file in the test/ directory that likely contains tests.

pub type TestSourceFile {
  TestSourceFile(
    module_name: String,
    filepath: String,
    tests: List(TestFunction),
  )
}

Constructors

  • TestSourceFile(
      module_name: String,
      filepath: String,
      tests: List(TestFunction),
    )

    Arguments

    module_name

    The name of the Gleam module.

    filepath

    The filepath to the .gleam file.

    tests

    The list of tests in the file.

Values

pub fn identify_tests(
  test_files: List(TestSourceFile),
  ctx: context.Context,
) -> List(TestFile)

Identifies all of the tests contained in the given list of TestSourceFiles.

Any files that don’t have any tests will be excluded from the result.

pub fn locate_test_files(
  ctx: context.Context,
) -> Result(List(TestSourceFile), Nil)

Returns the list of files in the test/ directory.

Search Document