@zuke/jest

← API reference

`@zuke/jest` — typed `jest` task wrappers for Zuke builds.

Symbols

# JestSettings class
class JestSettings extends ToolSettings

Settings for a jest run.

MemberSignatureDoc
paths paths(...values: PathLike[]): this Regex patterns matched against test paths (positional); repeatable.
config config(path: PathLike): this Use an explicit config file (-c/--config).
coverage coverage(): this Collect test coverage (--coverage).
watch watch(): this Watch files related to changed files (--watch).
watchAll watchAll(): this Watch all files (--watchAll).
ci ci(): this Run in CI mode, failing on new snapshots (--ci).
runInBand runInBand(): this Run all tests serially in the current process (-i/--runInBand).
maxWorkers maxWorkers(value: string | number): this Limit worker count, e.g. 2 or 50% (--maxWorkers).
updateSnapshot updateSnapshot(): this Re-record snapshots (-u/--updateSnapshot).
bail bail(suites?: number): this Stop after N failing test suites (--bail).
verbose verbose(): this Report each individual test (--verbose).
silent silent(): this Prevent tests from printing to the console (--silent).
testNamePattern testNamePattern(pattern: string): this Run only tests whose name matches the pattern (-t/--testNamePattern).
onlyChanged onlyChanged(): this Run only tests affected by changed files (-o/--onlyChanged).
passWithNoTests passWithNoTests(): this Pass when no tests are found (--passWithNoTests).
detectOpenHandles detectOpenHandles(): this Detect handles keeping the process open (--detectOpenHandles).
selectProjects selectProjects(...names: string[]): this Restrict to named projects (--selectProjects); repeatable.
reporters reporters(...names: string[]): this Use the named reporters (--reporters); repeatable.
# JestTasks const
const JestTasks: JestTasksApi

Typed task functions for the jest test runner.

# JestTasksApi interface
interface JestTasksApi

The shape of JestTasks.

MemberSignatureDoc
run run(configure?: Configure<JestSettings>): Promise<CommandOutput> Run tests with jest.