Skip to content

Conversation

google-labs-jules[bot]
Copy link
Contributor

Fixes #194

This commit introduces Pester unit tests for the `Invoke-PsFzfRipgrep` function in `PSFzf.tests.ps1`.

The tests cover the following scenarios:
- Usage of the default `rg` command prefix when the `PSFZF_RG_PREFIX` environment variable is not set.
- Usage of a custom `rg` command prefix when `PSFZF_RG_PREFIX` is set.
- Correct behavior of the `-NoEditor` switch, ensuring `Resolve-Path` is called for output.
- Correct behavior when launching an editor (default), ensuring `Get-EditorLaunch` is called.

Mocks are used for `Invoke-Expression` (to simulate `fzf` execution and capture the command), `Get-EditorLaunch`, `Resolve-Path`, and `[FzfDefaultCmd]` to isolate the function's logic.
@kelleyma49 kelleyma49 closed this Jun 27, 2025
@kelleyma49 kelleyma49 deleted the test/invoke-psfzfripgrep-tests branch June 27, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Allow customization for rg command in Invoke-PsFzfRipgrep

1 participant