pub struct TestArgs {Show 33 fields
pub input: PathBuf,
pub each: bool,
pub output: Option<PathBuf>,
pub no_run: bool,
pub require_tests: bool,
pub format: TestFormat,
pub inspect: bool,
pub seed: Option<String>,
pub case: Vec<String>,
pub suite: Vec<String>,
pub partial_selection: bool,
pub coverage: bool,
pub against: Option<String>,
pub skip_unsupported: bool,
pub settle: Option<String>,
pub smoke: bool,
pub print: bool,
pub smoke_unsafe: bool,
pub no_install: bool,
pub update_snapshots: bool,
pub declared_statuses: Option<PathBuf>,
pub dev_command: Option<PathBuf>,
pub mutate: bool,
pub only: Option<String>,
pub max_mutants: Option<usize>,
pub mutate_timeout: Option<u64>,
pub mutate_all_suites: bool,
pub mutate_fail_under: Option<u32>,
pub changed: Option<String>,
pub mutate_jobs: Option<u64>,
pub mutant_overlay: Option<(PathBuf, String)>,
pub run_timeout: Option<Duration>,
pub overlay: Option<HashMap<PathBuf, String>>,
}Expand description
The test subcommand’s flags — the one contract bynk test
#[command(flatten)]s (review findings #40/#72/#20/#21
remainder), replacing independent hand-spellings in each CLI.
Field docs here are the CLI help text for both commands’ flags.
Fields§
§input: PathBufInput project root directory. Defaults to the current directory.
each: boolRun over each project directly inside a directory that has no
bynk.toml of its own (#3274): as at a [workspace] root, one report
per project under a ── path ── header, every project run, and a
non-zero exit if any fails. A subdirectory without a bynk.toml is not
a project and is skipped. At a workspace root it changes nothing; at a
project, or inside one, it is an error. The flags that name one
project’s output (--format json, --output, --mutate, --against)
are refused, as at a workspace root.
output: Option<PathBuf>Where to write compiled TypeScript test runner modules.
Defaults to <input>/out.
no_run: boolSkip the runner invocation. With --format rich this emits the
generated test files (for CI flows that drive the runner separately);
with --format json it emits a discovery document listing every
suite and case (each outcome: "discovered") without running them —
a pure compile, no tsc/Node.
require_tests: boolFail (exit non-zero) when the project declares no tests, instead of the
default warning with exit 0. Applies with --no-run too, so a
discovery-only CI step can enforce it.
format: TestFormatOutput format. rich (default) is the grouped ✓ / ✗ human output;
json is a single pinned JSON document of results, for tooling;
ndjson is the same results as one JSON event per line, written as
each suite finishes. ndjson cannot be combined with --coverage or
--no-run.
inspect: boolCompile a debug build and launch the test runner under Node’s
inspector (node --inspect-brk), printing the inspector URL for a
JavaScript debugger to attach. The emitted .ts runs directly under
Node’s line-preserving type-stripping, so source maps resolve
breakpoints back to .bynk. Requires Node ≥ 22.18 (or ≥ 23.6
unflagged). Does not run tsc.
seed: Option<String>The root seed for generative property tests, as hex (e.g. 0x5f3a).
A failing property prints the seed it used; re-running with --seed <hex> reproduces that run byte-for-byte. Omitted, each run draws a
fresh random seed.
case: Vec<String>Run only the test cases named <name>, skipping the rest — the filter
behind the editor’s per-case ▷ Run Test lens. Matches by exact case
name across suites. Repeat the flag to run several cases in one
process; values of the same flag combine as “or”, and with --suite
as “and”. A name that selects no case fails the run. Omitted, every
case runs. No effect with --no-run (discovery lists all cases
regardless).
suite: Vec<String>Run only the cases of the suite named <name>, as the JSON document
reports it (suites[].name, without an integration suite’s prefix);
any suite kind matches. Repeat the flag to select several suites. A
suite that is not selected is left out of the output entirely. A name
that selects no suite fails the run. No effect with --no-run.
partial_selection: boolFor a caller that runs one selection as several processes (bynk test
across a workspace’s members, --against dev across env groups): this
run sees only part of the --case/--suite selection, so a value it
selects nothing for is not an error here. The caller judges the values.
coverage: boolAfter the suite runs, report statement/line coverage attributed to
.bynk source (a rich summary table, or a coverage block in
--format json). Requires the tsc → node path: incompatible with
--inspect and --no-run, and errors if only tsx is available.
against: Option<String>Run the system suites against a real runtime instead of in process:
dev, a local bynk dev the runner starts itself (through bynk test only), or a target named under [test.targets] in bynk.toml.
A bare URL is refused, and so is a target marked production = true.
A named target’s secrets are read from the environment. Only the
system suites run, and a case that uses what a real runtime can’t
honour (an on call address, advance Clock, a cron or queue address,
an asset fetch) is refused unless --skip-unsupported is passed.
skip_unsupported: boolWith --against, skip each system case a real runtime can’t
honour, naming it and why, instead of refusing the run.
settle: Option<String>With --against, how long a failing expect is retried before it
fails, for each retried stretch: the addresses since the last unsafe one (anything but GET,
HEAD or OPTIONS) are re-run before each retry, so a real system’s
latency doesn’t fail a case. A duration such as 5s, 500ms or 0
(no retry).
smoke: boolRun a smoke test of every from http route instead of the project’s
own suites (#2658): each route is called with arguments Val
fabricates and must not answer a 5xx or a body that does not decode; a
route with a JSON body must reject a malformed one, and a route behind
an actor must refuse a call with no credential. A route whose arguments
or principal can’t be fabricated is skipped and named. Combine with
--against to smoke a running system.
print: boolWith --smoke, print the synthesised suites as .bynk source and run
nothing: a starting point to copy into tests/ and extend.
smoke_unsafe: boolWith --smoke --against <target>, also call the routes that write
(POST, PUT, PATCH, DELETE). Without it a named target sees only
GET requests, since fabricated writes would land on a shared
deployment. In process and against dev every route is called.
no_install: boolDo not install the generated project’s npm packages: stop, naming the
install command and its directory, when one is missing. For projects that
provision node_modules themselves, and CI. Also set by
BYNK_NO_INSTALL=1.
update_snapshots: boolRecord snapshots instead of comparing against them: write a snapshot that
is not stored yet, refresh one whose value changed, and delete the
obsolete ones (those no expect … matches snapshot names any more).
Without it a missing snapshot fails the case, a changed one fails with a
diff, and an obsolete one is only reported. The files are
snapshots/<suite file>.snap.json, for review like code. Cannot be
combined with --against, --smoke, --coverage, --inspect or --no-run.
declared_statuses: Option<PathBuf>Not a flag. The file holding a smoke run’s declared response statuses
(smoke::DECLARED_ENV), set by bynk, which computes the table with
bynk-ide. Left None (as library callers and tests do), the runner
reads the variable from the environment (#2998, E1).
dev_command: Option<PathBuf>Not a flag. The bynk binary that starts bynk dev for
--against dev, set by bynk itself (it is that binary). Left None
(as library callers and tests do), it is read from
crate::remote::DEV_COMMAND_ENV.
mutate: boolCheck that the suites would notice a small change to the code (#3069):
apply typed mutations to src/ one at a time (a comparison operator
swapped, && and || exchanged), run the suites that exercise the
changed unit against each, and report the mutants that survive with
their source spans. Nothing in the working tree is written. The
unmutated project must pass first. Cannot be combined with --inspect,
--no-run, --coverage, --against, --smoke, --update-snapshots,
--case or --format ndjson.
only: Option<String>With --mutate, mutate only the declaration <unit.decl> (for example
orders.refund), or every declaration of the unit <unit>.
max_mutants: Option<usize>With --mutate, stop after this many mutants (in source order).
mutate_timeout: Option<u64>With --mutate, kill a mutant’s run after this many seconds and count
it killed by timeout. Default: three times the unmutated run, at least
ten seconds.
mutate_all_suites: boolWith --mutate, run every suite against every mutant, not only the
suites that target the mutated unit or a unit that uses it.
mutate_fail_under: Option<u32>With --mutate, exit non-zero when fewer than this percentage of the
mutants that ran were killed, or when no mutant reached a suite at all.
Without it surviving mutants are reported but do not fail the run.
changed: Option<String>With --mutate, mutate only the declarations in files that differ from
<GIT_REF> (#3134): the files git diff <GIT_REF> names, plus files git
does not track yet. The same mutants are reported as without the flag,
minus those in unchanged files.
mutate_jobs: Option<u64>With --mutate, run this many mutants at once, each in its own scratch
output directory (#3134). The report does not depend on it: the same
mutants, in the same order, with the same ids. Default 1.
mutant_overlay: Option<(PathBuf, String)>Not a flag. One source file’s text, replacing what is on disk for this
build: the mutant --mutate is running. The path is the key the
project’s source map holds the file under.
run_timeout: Option<Duration>Not a flag. Kill the test process, and fail the run, after this long.
overlay: Option<HashMap<PathBuf, String>>Not a flag. Source files layered over the project’s for this build, as
--sources-stdin does for compile, with the new ones it adds: the
synthetic suite of a bynk eval snippet (#3585) and the caller’s unsaved
buffers.
Trait Implementations§
Source§impl Args for TestArgs
impl Args for TestArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl FromArgMatches for TestArgs
impl FromArgMatches for TestArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for TestArgs
impl RefUnwindSafe for TestArgs
impl Send for TestArgs
impl Sync for TestArgs
impl Unpin for TestArgs
impl UnsafeUnpin for TestArgs
impl UnwindSafe for TestArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'a, T> FromIn<'a, T> for T
impl<'a, T> FromIn<'a, T> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'a, T, U> IntoIn<'a, U> for Twhere
U: FromIn<'a, T>,
impl<'a, T, U> IntoIn<'a, U> for Twhere
U: FromIn<'a, T>,
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);