Volt.Test.Runner (Volt v0.15.5)

Copy Markdown View Source

Executes Volt JavaScript and TypeScript test files in a QuickBEAM runtime.

This is the first, intentionally small, runner layer. It supports test files that use global Vitest-like helpers (describe, test, it, beforeEach, afterEach, and expect) provided by priv/ts/test/core.ts.

Test files may import helpers from volt:test; those virtual imports are stripped before bundling because the runtime provides the helpers as globals. Local relative JS/TS module graphs are bundled before execution.

Summary

Types

result()

@type result() :: map()

Functions

collect_file(path, opts \\ [])

@spec collect_file(
  Path.t(),
  keyword()
) :: {:ok, [map()]} | {:error, term()}

run_file(path, opts \\ [])

@spec run_file(
  Path.t(),
  keyword()
) :: {:ok, result()} | {:error, term()}

run_test(path, test_id, opts \\ [])

@spec run_test(Path.t(), integer(), keyword()) :: {:ok, result()} | {:error, term()}