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

clicking 'Update Tests' in vscode does not update snapshots #728

Closed
andylokandy opened this issue Feb 20, 2025 · 2 comments
Closed

clicking 'Update Tests' in vscode does not update snapshots #728

andylokandy opened this issue Feb 20, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@andylokandy
Copy link

andylokandy commented Feb 20, 2025

What happened?

As shown below, I'll expect insta to update all snapshot inside the test by clicking the button in vscode:

Image

But unfortunately, it'll invoke cargo test --package <package> --lib --all-features -- <test_path> --exact --nocapture instead of cargo insta test ...., so the test will not get updated.

Anyway, thanks for bringing this feature, and it'll be really helpful if it works!

Reproduction steps

No response

Insta Version

cargo-insta 1.42.1
vscode extension 1.0.7

rustc Version

rustc 1.86.0-nightly (854f22563 2025-01-31)

What did you expect?

No response

@andylokandy andylokandy added the bug Something isn't working label Feb 20, 2025
@max-sixty
Copy link
Collaborator

Yes, I haven't personally worked with the extension, and I think it likely needs some love. Contributions very welcome

@andylokandy
Copy link
Author

After some investigation, it turns out that the button is implemented by rust-analyzer, and the command the analyzer invokes is INSTA_UPDATE=always cargo test .....

Due to #490, the inline snapshots are not able to be updated with cargo test yet, so the button is not working for inline snapshots. I am closing this one in favor of #490.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants