You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
, and specifically in snapPathRel, _ := filepath.Rel(callerPath, snapPath).
callerPath is used "interchangeably" as a filename and a directory. It seems that in snapPathRel, _ := filepath.Rel(callerPath, snapPath) it was forgotten that it is a filename.
Apart from the necessary filepath.Dir(callerPath), I'd also suggest renaming this to callerFilename, highlighting its correct contents
Indeed I can reproduce the issue, and looking into it probably never worked correct. Not sure how I missed that. Will issue a pr later today fixing this. Again thank you for reporting this with clear steps on how to reproduce and the fix.
Description
For code https://github.com/stdedos/junit2html/blob/927e5218bb0ff447cd5390a7190a34db5a1b4b9a/tests/file_based_test.go#L94-L97, it seems that
go-snaps
will print the wrong snapshot path:(forget about the failing test)
The
at ../
path is clearly wrong - as theand the
path have the same parent folder.The issue is at
go-snaps/snaps/snapshot.go
Lines 256 to 274 in c578aa7
snapPathRel, _ := filepath.Rel(callerPath, snapPath)
.callerPath
is used "interchangeably" as a filename and a directory. It seems that insnapPathRel, _ := filepath.Rel(callerPath, snapPath)
it was forgotten that it is a filename.Apart from the necessary
filepath.Dir(callerPath)
, I'd also suggest renaming this tocallerFilename
, highlighting its correct contentsSteps to Reproduce
Run https://github.com/stdedos/junit2html/blob/927e5218bb0ff447cd5390a7190a34db5a1b4b9a/tests/file_based_test.go test
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: