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

resolveSnapshotPath to provide project root #6742

Closed
4 tasks done
unional opened this issue Oct 18, 2024 · 1 comment · Fixed by #6800
Closed
4 tasks done

resolveSnapshotPath to provide project root #6742

unional opened this issue Oct 18, 2024 · 1 comment · Fixed by #6800
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@unional
Copy link

unional commented Oct 18, 2024

Clear and concise description of the problem

Currently, test.resolveSnapshotPath(testfilePath, extension) does not provide a way to discover the project root.

This make it not possible to create snapshots relative to the project root in workspace use case.

for example:

- packages
  - project-a
    # want to create snapshots here, similar to the default of `jest-image-snapshot`
    - __snapshot__
- vitest.config.ts
- vitest.workspace.ts

Suggested solution

pass a context object to the function including project specific info, such as root and other information.

Alternative

No response

Additional context

No response

Validations

@sheremet-va
Copy link
Member

You might be interested in this: #1620

@sheremet-va sheremet-va moved this to P2 - 3 in Team Board Oct 21, 2024
@sheremet-va sheremet-va added p2-to-be-discussed Enhancement under consideration (priority) p2-nice-to-have Not breaking anything but nice to have (priority) and removed enhancement: pending triage p2-to-be-discussed Enhancement under consideration (priority) labels Oct 21, 2024
@sheremet-va sheremet-va moved this from P2 - 3 to Approved in Team Board Oct 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants