Skip to content

Commit 85a99e9

Browse files
committed
fix: assert --yolo is in task_and_args, not just fuzzy match
1 parent d997006 commit 85a99e9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • packages/cli/binding/src

packages/cli/binding/src/cli.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,8 @@ mod tests {
15401540

15411541
use clap::Parser;
15421542
use serde_json::json;
1543-
use vite_task::config::UserRunConfig;
1543+
use vite_str::Str;
1544+
use vite_task::{Command, config::UserRunConfig};
15441545

15451546
use super::{
15461547
CLIArgs, LintMessageKind, SynthesizableSubcommand, extract_unknown_argument,
@@ -1580,7 +1581,9 @@ mod tests {
15801581
// After trailing_var_arg change, unknown flags like --yolo are
15811582
// accepted as task arguments instead of producing a parse error.
15821583
let args = CLIArgs::try_parse_from(["vp", "run", "--yolo"]).unwrap();
1583-
assert!(matches!(args, CLIArgs::ViteTask(_)));
1584+
let debug = vite_str::format!("{args:?}");
1585+
assert!(debug.contains("\"--yolo\""), "Expected --yolo in task args, got: {debug}",);
1586+
assert!(matches!(args, CLIArgs::ViteTask(Command::Run(_))));
15841587
}
15851588

15861589
#[test]

0 commit comments

Comments
 (0)