-
Notifications
You must be signed in to change notification settings - Fork 45
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
Updating an inline snapshot writes to file but not to open editor #2761
Comments
Currently, Wallaby does not work properly with inline snapshots in some editors when not using auto-save. We are working on improving this behaviour and expect to have an updated version that correctly works when not using auto-save by the end of this week. We will reply to this issue when the updated version is available. |
That's fantastic, looking forward! |
We have updated Wallaby to better handle updating inline snapshots in unsaved files. Please update to the latest version of Wallaby and it will work without the problem that you identified. |
I had time to try this now and, unfortunately, something goes wrong on my end. Updating an inline snapshot in an unsaved file results in a test run failure. This is from the log:
Diagnostics report:
|
@ncirkel - this doesn't sound related to our change; the change that we made is actually downstream of this call and should be completely unrelated. Are you able to create a simple sample repo and step-by-step instructions so that we can replicate the issue? |
Issue description or question
I tend to have many unsaved files open when working with unit tests in VSCode. This is made possible by Wallaby detecting and running unsaved changes.
One thing I keep running into is having to save a file before updating inline snapshots. The update is written to the file on disk, but the open editor is unchanged. Wallaby reports all green on the outdated code and when trying to save, VSCode complains that the content of the file on disk is newer.
This also happens when typing
expect([...]).toMatchInlineSnapshot()
, which triggers inserting the initial snapshot. I have to remember to quickly save the file before it updates.I could certainly live with Wallaby saving the file before updating snapshots, if that's the easy solution to this.
Wallaby diagnostics report
(The relevant bit)
The text was updated successfully, but these errors were encountered: