Преглед на файлове

feat(cli): add clap parse test (#11189)

lets us catch runtime errors early on the testing phase - for instance when we add two arguments with the same flag
Lucas Fernandes Nogueira преди 10 месеца
родител
ревизия
11e9f2eb83
променени са 1 файла, в които са добавени 12 реда и са изтрити 0 реда
  1. 12 0
      crates/tauri-cli/src/lib.rs

+ 12 - 0
crates/tauri-cli/src/lib.rs

@@ -376,3 +376,15 @@ impl CommandExt for Command {
     }
   }
 }
+
+#[cfg(test)]
+mod tests {
+  use clap::CommandFactory;
+
+  use crate::Cli;
+
+  #[test]
+  fn verify_cli() {
+    Cli::command().debug_assert();
+  }
+}