zuke.tools.vitest
@zuke/vitest 1.1.0: @zuke/vitest — typed vitest task wrappers for Zuke builds.
zuke on PyPI ↗ 2 symbols
Symbols
class VitestSettings(ToolSettings) Settings for a vitest run.
-
filters(*values: str) -> SelfFilename filters matched against test files (positional); repeatable.
-
watch() -> SelfUse watch mode (
watch) instead of the default one-shotrun. -
config(path: str) -> SelfUse an explicit config file (
-c/--config). -
root(path: str) -> SelfProject root (
--root). -
dir(path: str) -> SelfRestrict the scanned directory (
--dir). -
coverage() -> SelfCollect test coverage (
--coverage). -
ui() -> SelfOpen the Vitest UI (
--ui). -
update() -> SelfUpdate snapshots (
-u/--update). -
force_run() -> SelfForce one-shot mode even under watch (
--run). -
pool(name: Literal['threads', 'forks', 'vmThreads', 'vmForks']) -> SelfChoose the worker pool implementation (
--pool). -
max_workers(count: float) -> SelfCap the number of parallel workers (
--maxWorkers). -
min_workers(count: float) -> SelfSet the minimum number of parallel workers (
--minWorkers). -
bail(count: float) -> SelfStop after N failed tests (
--bail). -
retry(count: float) -> SelfRetry failed tests up to N times (
--retry). -
shard(value: str) -> SelfRun a shard of the suite, e.g.
1/4(--shard). -
reporter(*names: str) -> SelfUse the named reporters (
--reporter); repeatable. -
output_file(path: str) -> SelfWrite report output to a file (
--outputFile). -
test_name_pattern(pattern: str) -> SelfRun only tests whose name matches the pattern (
-t/--testNamePattern). -
environment(value: str) -> SelfTest environment, e.g.
jsdom,node(--environment). -
globals() -> SelfEnable global test APIs (
--globals). -
pass_with_no_tests() -> SelfPass when no tests are found (
--passWithNoTests). -
silent() -> SelfSuppress test console output (
--silent).
class VitestTasks Typed task functions for the vitest test runner.
-
static async run(ctx: ServiceContext, configure: Callable[[VitestSettings], VitestSettings] | None=None) -> ExecResultRun tests with
vitest(one-shotrununless VitestSettings.watch).