aiden / autosnaps

An npm library for automatically collecting fixtures for snapshot tests that integrates easily with popular test runners
MIT License
0 stars 0 forks source link

Add a dummy withSnapshot HOF with some tests #10

Closed emilgoldsmith closed 5 years ago

emilgoldsmith commented 5 years ago

Hey @lingz, there is no real functionality here, but just wanted to check in with you concerning types. I think the best way here is just using the any casts I did, but since I consider you the type wizard I just wanted to get a second opinion, and see if maybe there is a clean way I missed?

I'll merge this when CI passes as I'm the only one working on it but please do give feedback even though it's merged if you suggest any changes I'll just do it in a different PR

lingz commented 5 years ago

I'm just wondering if there is a way to really hook it in from side-effect point of view, like rewire imports. It's debatable but some people might not like putting this into their prod code.

lingz commented 5 years ago

Or maybe with a decorator it would be a bit easier to put into the code, plus with a decorator you could use a string argument to preserve it across refactors.

emilgoldsmith commented 5 years ago

I looked at the spec for decorators though, and it only works in classes right? So that would not allow it to be used in more functional programming, yeah?

lingz commented 5 years ago

ah ok yes you are right

On Mon, Oct 15, 2018 at 2:18 PM Emil Goldsmith Olesen < notifications@github.com> wrote:

I looked at the spec for decorators though, and it only works in classes right? So that would not allow it to be used in more functional programming, yeah?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aiden/autosnaps/pull/10#issuecomment-429847111, or mute the thread https://github.com/notifications/unsubscribe-auth/ADAFzQ3F6kX82T5_ehsisGiJASLbpPNqks5ulIswgaJpZM4XbJfy .