Skip to content

Commit 64203a6

Browse files
committed
test: add assertions for 'vpr' command completion in env files
1 parent aed5c4b commit 64203a6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

  • crates/vite_global_cli/src/commands/env

crates/vite_global_cli/src/commands/env/setup.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,6 @@ mod tests {
901901
let fish_content = tokio::fs::read_to_string(home.join("env.fish")).await.unwrap();
902902
let ps1_content = tokio::fs::read_to_string(home.join("env.ps1")).await.unwrap();
903903

904-
// Verify completion env is set
905904
assert!(
906905
env_content.contains("VP_COMPLETE=bash") && env_content.contains("VP_COMPLETE=zsh"),
907906
"env file should contain completion for bash and zsh"
@@ -914,5 +913,15 @@ mod tests {
914913
ps1_content.contains("VP_COMPLETE = \"powershell\""),
915914
"env.ps1 file should contain completion for PowerShell"
916915
);
916+
917+
assert!(
918+
env_content.contains("compdef _vpr_complete vpr"),
919+
"env should have vpr completion for zsh"
920+
);
921+
assert!(fish_content.contains("complete -c vpr"), "env.fish should have vpr completion");
922+
assert!(
923+
ps1_content.contains("Register-ArgumentCompleter -Native -CommandName vpr"),
924+
"env.ps1 should have vpr completion"
925+
);
917926
}
918927
}

0 commit comments

Comments
 (0)