Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: normalize snapshot paths for tests outside the main tests directory #1373

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

clementbirkle
Copy link

What:

  • Bug Fix
  • New Feature

Description:

This PR fixes an inconsistency with snapshot paths for test files located outside the main /tests directory.

Current behavior:

  • For tests outside the /tests directory, the generated snapshot paths include the full system path
  • This creates inconsistent paths across different environments:
    • Local: /tests/.pest/snapshots/app/app/MyDirectory/MyTest.php
    • Staging: /tests/.pest/snapshots/home/my-website.com/app/MyDirectory/MyTest.php

Fixed behavior:

  • Normalizes snapshot paths to be relative to the project root
  • Preserves the logical directory structure (e.g., app/MyDirectory/)
  • Creates consistent paths across all environments
  • Maintains backward compatibility for tests inside the /tests directory

This makes snapshots more portable between environments and easier to manage in version control.

Related:

Sorry, something went wrong.

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.

None yet

1 participant