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

INSTA_UPDATE=always cargo test with an incorrect inline snapshot passes #478

Open
max-sixty opened this issue May 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@max-sixty
Copy link
Collaborator

max-sixty commented May 2, 2024

What happened?

with a test like:

    #[test]
    fn test_inline() {
        insta::assert_snapshot!(3 + 2, @"");
    }

... running INSTA_UPDATE=always cargo test gives:

error: cannot update inline snapshots in-place (https://github.com/mitsuhiko/insta/issues/272)
test tests::test_inline ... ok

But then returns a zero exit code

Arguably this should return a non-zero exit code, to indicate the snapshots are not correct

Reproduction steps

No response

Insta Version

1.38

rustc Version

1.77.2

What did you expect?

No response

@max-sixty max-sixty added the bug Something isn't working label May 2, 2024
@max-sixty max-sixty changed the title INSTA_UPDATE=always cargo test with an incorrect snapshot passes INSTA_UPDATE=always cargo test with an incorrect inline snapshot passes May 2, 2024
@mitsuhiko
Copy link
Owner

I would like to fix this by implementing inline snapshot updates without the need of cargo-insta. See #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