GithubHelp home page GithubHelp logo

Comments (2)

theramis avatar theramis commented on May 23, 2024

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.

  1. Compare new snapshot vs old snapshot
  2. Decide whether to update snapshot
  3. 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.

LaurenceJKing avatar LaurenceJKing commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.