Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

refactor: simplify test normalization by using insta filters (#672)

Maximilian Roosffe2d41b424a
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 86b5fc704..aadc2d098 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -2358,13 +2358,11 @@ pub fn setup_temp_snapshot_settings(temp_path: &std::path::Path) -> insta::Setti
/// Add filters for PTY-specific artifacts that vary between platforms.
///
/// This handles:
-/// - CRLF line endings (PTYs use \r\n)
/// - macOS PTY control sequences (^D followed by backspaces)
/// - Leading ANSI reset codes that vary between macOS and Linux
+///
+/// Note: CRLF normalization is done eagerly in PTY exec functions, not here.
pub fn add_pty_filters(settings: &mut insta::Settings) {
- // PTYs use \r\n line endings, normalize to \n
- settings.add_filter(r"\r\n", "\n");
-
// macOS PTYs emit ^D (literal caret-D) followed by backspaces (0x08)
// when EOF is signaled. Linux PTYs don't. Strip these for consistency.
settings.add_filter(r"\^D\x08+", "");
@@ -2375,36 +2373,6 @@ pub fn add_pty_filters(settings: &mut insta::Settings) {
settings.add_filter(r"(?m)^\x1b\[0m", "");
}
-/// Add filters for temporary directory paths in PTY output.
-///
-/// PTY tests create temp directories that appear in output. These paths vary
-/// per test run and need normalization.
-///
-/// # Arguments
-/// * `settings` - The insta Settings to add filters to
-/// * `placeholder` - The placeholder text to use (e.g., "[TMPDIR]", "_REPO_")
-pub fn add_pty_tmpdir_filters(settings: &mut insta::Settings, placeholder: &str) {
- // macOS temp paths: /private/var/folders/.../T/.tmpXXX or /var/folders/.../T/.tmpXXX
- settings.add_filter(
- r"(?:/private)?/var/folders/[^/]+/[^/]+/T/\.tmp[^\s/'\x1b\)]+",
- placeholder,
- );
-
- // Linux temp paths: /tmp/.tmpXXX
- settings.add_filter(r"/tmp/\.tmp[^\s/'\x1b\)]+", placeholder);
-
- // Fish shell temp paths: /tmp/.psubXXX (process substitution)
- settings.add_filter(r"/tmp/\.psub[^\s/'\x1b\)]+", placeholder);
-
- // Collapse duplicate placeholders that can appear with nested mktemp paths.
- // e.g., [TMPDIR]/[TMPDIR]/foo -> [TMPDIR]/foo
- let collapse_pattern = format!(
- r"\[{0}](?:/?\[{0}])+",
- regex::escape(placeholder.trim_matches(|c| c == '[' || c == ']'))
- );
- settings.add_filter(&collapse_pattern, placeholder);
-}
-
/// Add filters for binary paths (target/debug/wt) in PTY output.
///
/// Test binaries are run from the cargo target directory, which varies.
diff --git a/tests/common/shell.rs b/tests/common/shell.rs
index 18eecf29b..eb18a236d 100644
--- a/tests/common/shell.rs
+++ b/tests/common/shell.rs
@@ -130,7 +130,8 @@ pub fn execute_shell_script(repo: &TestRepo, shell: &str, script: &str) -> Strin
);
}
- buf
+ // Normalize CRLF to LF (PTYs use CRLF on some platforms)
+ buf.replace("\r\n", "\n")
}
/// Generate `wt config shell init <shell>` output for the repo.
diff --git a/tests/integration_tests/approval_pty.rs b/tests/integration_tests/approval_pty.rs
index 47b7984c5..a86c86b10 100644
--- a/tests/integration_tests/approval_pty.rs
+++ b/tests/integration_tests/approval_pty.rs
@@ -62,7 +62,10 @@ fn exec_in_pty_with_input(
let exit_status = child.wait().unwrap();
let exit_code = exit_status.exit_code() as i32;
- (buf, exit_code)
+ // Normalize CRLF to LF (PTYs use CRLF on some platforms)
+ let normalized = buf.replace("\r\n", "\n");
+
+ (normalized, exit_code)
}
/// Create insta settings for approval PTY tests.
diff --git a/tests/integration_tests/config_state.rs b/tests/integration_tests/config_state.rs
index 8393f15fb..a133b1aac 100644
--- a/tests/integration_tests/config_state.rs
+++ b/tests/integration_tests/config_state.rs
@@ -1,15 +1,14 @@
use crate::common::{TEST_EPOCH, TestRepo, repo, wt_command};
use insta::assert_snapshot;
-use regex::Regex;
use rstest::rstest;
use std::process::Command;
-/// Normalize LOG FILES path in output for stable snapshots (temp dir varies per test)
-fn normalize_log_path(output: &str) -> String {
- // Match "LOG FILES" followed by ANSI codes, spaces, and "@ " then the path
- // Pattern: LOG FILES + optional ANSI reset + spaces + @ + path until newline
- let re = Regex::new(r"(LOG FILES\x1b\[39m\s+@ )[^\n]+").unwrap();
- re.replace_all(output, "${1}<PATH>").to_string()
+/// Settings for `wt config state get` snapshots (normalizes log paths)
+fn state_get_settings() -> insta::Settings {
+ let mut settings = insta::Settings::clone_current();
+ // LOG FILES path varies per test (temp dir), normalize for stable snapshots
+ settings.add_filter(r"(LOG FILES\x1b\[39m\s+@ )[^\n]+", "${1}<PATH>");
+ settings
}
/// Write CI status to the file-based cache at .git/wt-cache/ci-status/<branch>.json
@@ -652,7 +651,8 @@ fn test_state_clear_all_nothing_to_clear(repo: TestRepo) {
fn test_state_get_empty(repo: TestRepo) {
let output = wt_state_get_cmd(&repo).output().unwrap();
assert!(output.status.success());
- assert_snapshot!(normalize_log_path(&String::from_utf8_lossy(&output.stderr)), @"
+ state_get_settings().bind(|| {
+ assert_snapshot!(String::from_utf8_lossy(&output.stderr), @"
DEFAULT BRANCH
  main
@@ -671,6 +671,7 @@ fn test_state_get_empty(repo: TestRepo) {
LOG FILES @ <PATH>
  (none)
");
+ });
}
#[rstest]
@@ -700,7 +701,9 @@ fn test_state_get_with_ci_entries(repo: TestRepo) {
let output = wt_state_get_cmd(&repo).output().unwrap();
assert!(output.status.success());
- assert_snapshot!(normalize_log_path(&String::from_utf8_lossy(&output.stderr)));
+ state_get_settings().bind(|| {
+ assert_snapshot!(String::from_utf8_lossy(&output.stderr));
+ });
}
#[rstest]
@@ -747,7 +750,9 @@ fn test_state_get_comprehensive(repo: TestRepo) {
let output = wt_state_get_cmd(&repo).output().unwrap();
assert!(output.status.success());
- assert_snapshot!(normalize_log_path(&String::from_utf8_lossy(&output.stderr)));
+ state_get_settings().bind(|| {
+ assert_snapshot!(String::from_utf8_lossy(&output.stderr));
+ });
}
#[rstest]
diff --git a/tests/integration_tests/configure_shell.rs b/tests/integration_tests/configure_shell.rs
index 1764ffcdf..6394b2788 100644
--- a/tests/integration_tests/configure_shell.rs
+++ b/tests/integration_tests/configure_shell.rs
@@ -1532,7 +1532,9 @@ fn test_uninstall_shell_dry_run_multiple(repo: TestRepo, temp_home: TempDir) {
// PTY-based tests for interactive install preview
#[cfg(all(unix, feature = "shell-integration-tests"))]
mod pty_tests {
- use crate::common::{TestRepo, configure_pty_command, open_pty, repo, temp_home};
+ use crate::common::{
+ TestRepo, add_pty_filters, configure_pty_command, open_pty, repo, temp_home,
+ };
use insta::assert_snapshot;
use insta_cmd::get_cargo_bin;
use portable_pty::CommandBuilder;
@@ -1580,42 +1582,33 @@ mod pty_tests {
let exit_status = child.wait().unwrap();
let exit_code = exit_status.exit_code() as i32;
- (buf, exit_code)
+ // Normalize CRLF to LF (PTYs use CRLF on some platforms)
+ let normalized = buf.replace("\r\n", "\n");
+
+ (normalized, exit_code)
}
- /// Normalize output for snapshot testing
- fn normalize_output(output: &str, temp_home: &TempDir) -> String {
- // PTYs use \r\n line endings, normalize to \n
- let output = output.replace("\r\n", "\n");
+ /// Create insta settings for install PTY tests.
+ fn install_pty_settings(temp_home: &TempDir) -> insta::Settings {
+ let mut settings = insta::Settings::clone_current();
- // Remove ^D control sequence that appears on macOS
- let output = regex::Regex::new(r"\^D\x08+")
- .unwrap()
- .replace_all(&output, "");
+ // Add PTY filters (CRLF, ^D, leading ANSI resets)
+ add_pty_filters(&mut settings);
// Remove echoed user input at end of prompt line (PTY echo timing varies).
- // The prompt ends with [y/N/?][22m and then the echoed input appears.
- // Normalize to just the prompt without echoed input.
- let output = regex::Regex::new(r"(\[y/N/\?\]\x1b\[22m) [yn]")
- .unwrap()
- .replace_all(&output, "$1 ");
+ // The prompt ends with [y/N/?][22m and then the echoed input appears.
+ settings.add_filter(r"(\[y/N/\?\]\x1b\[22m) [yn]", "$1 ");
// Remove standalone echoed input lines (just y or n on their own line)
- // that appear due to PTY timing differences
- let output = regex::Regex::new(r"^[yn]\n").unwrap().replace(&output, "");
-
- // Normalize blank lines caused by PTY echo timing variations.
- // The newline from user input can appear at different positions relative
- // to the prompt text depending on the system. Collapse consecutive newlines
- // to a single newline, then strip any leading newline.
- let output = regex::Regex::new(r"\n{2,}")
- .unwrap()
- .replace_all(&output, "\n");
- let output = output.trim_start_matches('\n');
+ settings.add_filter(r"^[yn]\n", "");
+
+ // Collapse consecutive newlines (PTY timing variations)
+ settings.add_filter(r"\n{2,}", "\n");
// Replace temp home path with ~/
- let home_path = temp_home.path().to_string_lossy();
- output.replace(&*home_path, "~").to_string()
+ settings.add_filter(&regex::escape(&temp_home.path().to_string_lossy()), "~");
+
+ settings
}
/// Test that `wt config shell install` shows preview with gutter-formatted config lines
@@ -1626,10 +1619,11 @@ mod pty_tests {
fs::write(&zshrc_path, "# Existing config\n").unwrap();
let (output, exit_code) = exec_install_in_pty(&temp_home, &repo, "y\n");
- let normalized = normalize_output(&output, &temp_home);
assert_eq!(exit_code, 0);
- assert_snapshot!(normalized);
+ install_pty_settings(&temp_home).bind(|| {
+ assert_snapshot!(output.trim_start_matches('\n'));
+ });
}
/// Test that declining install shows preview but doesn't modify files
@@ -1639,11 +1633,12 @@ mod pty_tests {
fs::write(&zshrc_path, "# Existing config\n").unwrap();
let (output, exit_code) = exec_install_in_pty(&temp_home, &repo, "n\n");
- let normalized = normalize_output(&output, &temp_home);
// User declined, so exit code is 1
assert_eq!(exit_code, 1);
- assert_snapshot!(normalized);
+ install_pty_settings(&temp_home).bind(|| {
+ assert_snapshot!(output.trim_start_matches('\n'));
+ });
// Verify file was not modified
let content = fs::read_to_string(&zshrc_path).unwrap();
diff --git a/tests/integration_tests/shell_integration_prompt.rs b/tests/integration_tests/shell_integration_prompt.rs
index 4a0d66278..12e80375d 100644
--- a/tests/integration_tests/shell_integration_prompt.rs
+++ b/tests/integration_tests/shell_integration_prompt.rs
@@ -262,7 +262,10 @@ mod pty_tests {
let exit_status = child.wait().unwrap();
let exit_code = exit_status.exit_code() as i32;
- (buf, exit_code)
+ // Normalize CRLF to LF (PTYs use CRLF on some platforms)
+ let normalized = buf.replace("\r\n", "\n");
+
+ (normalized, exit_code)
}
/// Normalize output for snapshot testing
@@ -279,10 +282,7 @@ mod pty_tests {
// Remove home directory paths
let home_str = home_dir.display().to_string();
- let output = output.replace(&home_str, "[HOME]");
-
- // PTYs use \r\n line endings, normalize to \n
- output.replace("\r\n", "\n")
+ output.replace(&home_str, "[HOME]")
}
/// Test: Already installed (config line exists) → skip prompt
diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rs
index 74ad768f4..88d4ef9cc 100644
--- a/tests/integration_tests/shell_wrapper.rs
+++ b/tests/integration_tests/shell_wrapper.rs
@@ -38,7 +38,7 @@ use std::process::Command;
// Unix-only imports
#[cfg(unix)]
use {
- crate::common::{add_pty_filters, add_pty_tmpdir_filters, canonicalize, wait_for_file_content},
+ crate::common::{add_pty_filters, canonicalize, wait_for_file_content},
insta::assert_snapshot,
std::{fs, path::PathBuf, sync::LazyLock},
worktrunk::shell,
@@ -99,28 +99,14 @@ impl ShellOutput {
}
}
-/// Create insta settings configured for shell wrapper snapshot tests.
+/// Insta settings for shell wrapper tests.
///
-/// This sets up filters for:
-/// - PTY-specific artifacts (CRLF, ^D control sequences, ANSI resets)
-/// - Temporary directory paths
-/// - Project root paths (for fixture references)
+/// Inherits snapshot_path and path filters from TestRepo (bound to scope),
+/// then adds PTY-specific filters for cross-platform consistency.
#[cfg(unix)]
fn shell_wrapper_settings() -> insta::Settings {
let mut settings = insta::Settings::clone_current();
- settings.set_snapshot_path("../snapshots");
-
- // Add common PTY filters (CRLF, ^D, leading ANSI resets)
add_pty_filters(&mut settings);
-
- // Add temp directory path filters
- add_pty_tmpdir_filters(&mut settings, "[TMPDIR]");
-
- // Normalize project root paths (for fixture references like tests/fixtures/)
- if let Ok(manifest_dir) = std::env::var("CARGO_MANIFEST_DIR") {
- settings.add_filter(&regex::escape(&manifest_dir), "[PROJECT_ROOT]");
- }
-
settings
}
@@ -320,11 +306,6 @@ fn build_shell_script(shell: &str, repo: &TestRepo, subcommand: &str, args: &[&s
}
}
-/// Normalize line endings (CRLF -> LF)
-fn normalize_newlines(s: &str) -> String {
- s.replace("\r\n", "\n")
-}
-
/// Execute a command in a PTY with interactive input support
///
/// This is similar to `exec_in_pty` but allows sending input during execution.
@@ -462,7 +443,10 @@ fn exec_in_pty_interactive(
let status = child.wait().unwrap();
- (normalize_newlines(&buf), status.exit_code() as i32)
+ // Normalize CRLF to LF (PTYs use CRLF on some platforms)
+ let normalized = buf.replace("\r\n", "\n");
+
+ (normalized, status.exit_code() as i32)
}
/// Execute bash in true interactive mode by writing commands to the PTY
@@ -569,7 +553,10 @@ fn exec_bash_truly_interactive(
// Get the captured output
let buf = reader_thread.join().unwrap();
- (normalize_newlines(&buf), status.exit_code() as i32)
+ // Normalize CRLF to LF (same as exec_in_pty_interactive)
+ let normalized = buf.replace("\r\n", "\n");
+
+ (normalized, status.exit_code() as i32)
}
/// Execute a command through a shell wrapper
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap
index 55325896b..629d7adb3 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap
@@ -7,10 +7,10 @@ y
▲ repo needs approval to execute 1 command:
○ post-create:
-  echo 'test command'
+  echo 'test command'
❯ Allow and remember? [y/N]
◎ Running post-create project hook @ _REPO_.test-approve:
-  echo 'test command'
+  echo 'test command'
test command
✓ Created branch test-approve from main and worktree @ _REPO_.test-approve
↳ To customize worktree locations, run wt config create
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap
index 128cd02f2..954317af0 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap
@@ -7,7 +7,7 @@ n
▲ repo needs approval to execute 1 command:
○ post-create:
-  echo 'test command'
+  echo 'test command'
❯ Allow and remember? [y/N]
○ Commands declined, continuing worktree creation
✓ Created branch test-decline from main and worktree @ _REPO_.test-decline
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap
index aed1d0a6a..368f06003 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap
@@ -7,18 +7,18 @@ y
▲ repo needs approval to execute 2 commands:
○ post-create first:
-  echo 'First command'
+  echo 'First command'
○ post-create third:
-  echo 'Third command'
+  echo 'Third command'
❯ Allow and remember? [y/N]
◎ Running post-create project:first @ _REPO_.test-mixed-accept:
-  echo 'First command'
+  echo 'First command'
First command
◎ Running post-create project:second @ _REPO_.test-mixed-accept:
-  echo 'Second command'
+  echo 'Second command'
Second command
◎ Running post-create project:third @ _REPO_.test-mixed-accept:
-  echo 'Third command'
+  echo 'Third command'
Third command
✓ Created branch test-mixed-accept from main and worktree @ _REPO_.test-mixed-accept
↳ To customize worktree locations, run wt config create
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap
index 8a310f1e8..73d51cf3d 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap
@@ -7,9 +7,9 @@ n
▲ repo needs approval to execute 2 commands:
○ post-create first:
-  echo 'First command'
+  echo 'First command'
○ post-create third:
-  echo 'Third command'
+  echo 'Third command'
❯ Allow and remember? [y/N]
○ Commands declined, continuing worktree creation
✓ Created branch test-mixed-decline from main and worktree @ _REPO_.test-mixed-decline
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap
index d649e76d5..53cd2dc28 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap
@@ -7,20 +7,20 @@ y
▲ repo needs approval to execute 3 commands:
○ post-create first:
-  echo 'First command'
+  echo 'First command'
○ post-create second:
-  echo 'Second command'
+  echo 'Second command'
○ post-create third:
-  echo 'Third command'
+  echo 'Third command'
❯ Allow and remember? [y/N]
◎ Running post-create project:first @ _REPO_.test-multi:
-  echo 'First command'
+  echo 'First command'
First command
◎ Running post-create project:second @ _REPO_.test-multi:
-  echo 'Second command'
+  echo 'Second command'
Second command
◎ Running post-create project:third @ _REPO_.test-multi:
-  echo 'Third command'
+  echo 'Third command'
Third command
✓ Created branch test-multi from main and worktree @ _REPO_.test-multi
↳ To customize worktree locations, run wt config create
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap
index 358ff7a79..dfed37a2b 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap
@@ -7,20 +7,20 @@ y
▲ repo needs approval to execute 3 commands:
○ post-create install:
-  echo 'Installing dependencies...'
+  echo 'Installing dependencies...'
○ post-create build:
-  echo 'Building project...'
+  echo 'Building project...'
○ post-create test:
-  echo 'Running tests...'
+  echo 'Running tests...'
❯ Allow and remember? [y/N]
◎ Running post-create project:install @ _REPO_.test-named:
-  echo 'Installing dependencies...'
+  echo 'Installing dependencies...'
Installing dependencies...
◎ Running post-create project:build @ _REPO_.test-named:
-  echo 'Building project...'
+  echo 'Building project...'
Building project...
◎ Running post-create project:test @ _REPO_.test-named:
-  echo 'Running tests...'
+  echo 'Running tests...'
Running tests...
✓ Created branch test-named from main and worktree @ _REPO_.test-named
↳ To customize worktree locations, run wt config create
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap
index d81b9102d..b97f10265 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap
@@ -7,12 +7,12 @@ y
▲ repo needs approval to execute 1 command:
○ post-create:
-  echo 'test command'
+  echo 'test command'
❯ Allow and remember? [y/N]
▲ Failed to save command approval: Failed to write config file: Permission denied (os error 13)
↳ Approval will be requested again next time.
◎ Running post-create project hook @ _REPO_.test-permission:
-  echo 'test command'
+  echo 'test command'
test command
✓ Created branch test-permission from main and worktree @ _REPO_.test-permission
↳ To customize worktree locations, run wt config create
diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_remove_decline.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_remove_decline.snap
index 0a8590552..380582b6c 100644
--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_remove_decline.snap
+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_remove_decline.snap
@@ -7,7 +7,7 @@ n
▲ repo needs approval to execute 1 command:
○ pre-remove:
-  echo 'pre-remove hook'
+  echo 'pre-remove hook'
❯ Allow and remember? [y/N]
○ Commands declined, continuing removal
◎ Removing to-remove worktree & branch in background (ancestor of main, ⊂)
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snap b/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snap
index d763e4b33..097e8d61a 100644
--- a/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snap
+++ b/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snap
@@ -1,6 +1,7 @@
---
source: tests/integration_tests/configure_shell.rs
-expression: normalized
+expression: "output.trim_start_matches('\\n')"
---
+
❯ Install shell integration? [y/N/?]
✗ Cancelled by user
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snap b/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snap
index ea53af0fc..ced466a2c 100644
--- a/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snap
+++ b/tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snap
@@ -1,7 +1,8 @@
---
source: tests/integration_tests/configure_shell.rs
-expression: normalized
+expression: "output.trim_start_matches('\\n')"
---
+
❯ Install shell integration? [y/N/?]
✓ Added shell extension & completions for zsh @ ~/.zshrc
↳ Skipped bash; ~/.bashrc not found