t.Run("my test", func(t *testing.T) {
user := struct{ Name string }{
Name: "george",
}
snaps.MatchInlineSnapshot(t, user, nil)
})
and then it will populate with the snapshot data
t.Run("my test", func(t *testing.T) {
user := struct{ Name string }{
Name: "george",
}
snaps.MatchInlineSnapshot(t, user, snaps.Inline("struct { Name string }{Name:\"george\"}"))
})
Still haven't investigated all the edge cases that this can have and I can see being useful but not sure how much is it worth it.
Two issues that are not addressed
[x] Long line snapshots, haven't found a way to split text to multiples lines
I believe jest doesn't address it at all. I want to also have a look how it's handled by insta.
[ ] Comments ast parsing.
I have seen some weird behaviours, but nothing major. I want to test further.
[x] Currently there is an issue with the current approach. If a file has multiple InlineSnapshots and updated at the same time the file lines can be moved breaking the "write". I am investigating ways to fix this.
[ ] I want to run tests to make concurrent (t.Parallel) safe.
The api right now looks like
Calling the first time
and then it will populate with the snapshot data
Still haven't investigated all the edge cases that this can have and I can see being useful but not sure how much is it worth it.
Two issues that are not addressed