Comments (2)
Hey @LaurenceJKing,
Sorry about the super late reply.
Currently, the only way to update a snapshot is via the UpdateSnapshot attribute (or the environment variable). Both of these solutions require changing the code.
Another possible solution which wouldn't require code is to set the UpdateSnapshot
environment variable outside of your code (e.g. in your terminal). This way it would not get committed. Thoughts?
Allow users to override the UpdateSnapshot attribute with other behaviors (such as opening a diff window) when the snapshots do not match. I don't think that Snapper needs to provide any of those behaviors out of the box - but if we could make it more extensible then users could roll their own.
Correct me if I'm wrong but it sounds like what you are wanting to be to able to override something like https://github.com/theramis/Snapper/blob/master/project/Snapper/Core/SnapshotUpdateDecider.cs.
The core logic of Snapper can basically be explained in 3 steps.
- Compare new snapshot vs old snapshot
- Decide whether to update snapshot
- Update or Assert snapshot
It sounds like you'd like to make step 2 customisable/extendable? Would that be correct?
Assuming I've interpreted your problem/solution correctly. If step 2 was customisable I'd be keen to hear how you would implement step 2 so that it doesn't require code changes. You mentioned a diff window, I imagine as part of the diff window you'd need like an update button too so you can tell step 3 whether to update or not.
from snapper.
Hi @theramis,
Thanks for getting back to me.
I've been tinkering with this for a while, and I don't think my suggestion of a diff window will really work (all the tools I have come across require two files to compare - but Snapper only saves the old snapshot (which is one of the things I love about it).
Setting the environment variable from the terminal could be the way to go. Thanks.
from snapper.
Related Issues (20)
- Add support of self referencing loop HOT 3
- [BUG] Snapshots do not match HOT 4
- [BUG] ArgumentException: Object serialized to String. JObject instance expected. HOT 4
- [DOCUMENTATION] SupportedTestMethodNotFoundException HOT 3
- Approach to Environment.NewLine HOT 6
- Use Custom DSL instead of Inheriting NUnit.Framework.Is HOT 5
- Allow exclusion of fields HOT 2
- Create snapshot on first run if none exists HOT 1
- Add support for Specflow
- Allow customising the serializer settings for Snapshots HOT 2
- Add alternative snapshots for decimal values HOT 4
- Serializing non json values HOT 2
- SnapshotDoesNotExistException on Azure Pipelines ubuntu-20.04 Agent HOT 4
- Plain text serialization HOT 4
- Snapshot created with different serialization settings HOT 6
- Enable changing only the snapshot filename HOT 6
- Support NExpect HOT 9
- Support for Unity Test Framework HOT 5
- Remove support for .net 45 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snapper.