-
Notifications
You must be signed in to change notification settings - Fork 0
Autosnaps Spec #9
Comments
MotivationSnapshotting can be a very useful testing tool, but especially gathering fixtures can be time consuming. We would like to automate this. Proposed solutionWe introduce AutoSnaps! (name up for discussion if you don't like it) AutoSnaps' core functionality would consist of
Finer pointsFile namesI propose that we store files in a
Stripping extensionsA point of discussion is whether and/or how we should strip extensions of original filenames. Since we specifically had some pain with Having two types of filesI have currently proposed having two types of files, but this can of course also be up for discussion as they could also easily be consolidated into one file per original file that just stores both fixtures and snapshots. I think it might be slightly easier to read the files manually when it's split, since fixtures and snapshots can be very big, and often one can be a lot bigger than the other. This is mostly just my initial instinct though and is very up for discussion Locating original functionOne of the biggest challenges I have come up against while designing this library is how to know where the original function is from inside the called HOF. My current thoughts on it are:
AUTOSNAPS environment variableI'm thinking that we will be able to set this environment variable to two different names
Where square brackets means optional argument, and a AutoSnaps CLII think we need a simple binary with a few core features in order to manage AutoSnaps' features. I propose the following features / commands:
I think all of these should each be pretty simple to implement, especially since there are good npm libraries out there that deal with CLI interfaces. Overall ConI also realized that this will only (at least in a straight forward manner) work with Node.js. Unless we put more thought into it and maybe somehow setup a server on localhost and communicate from the browser to that server within AutoSnaps will we be able to write on the server from within browser JS. |
Hey Emil, Sorry for delay, been super packed round these days :) It looks very good, I think you should definitely get started. I've sure you have thought of many of these, but here's some working comments:
Very looking forward to what comes out, it could save us (and everyone else) a lot of time! |
No worries, good luck on all the stuff you're working on!
I'll try and slowly get started on something this week! |
Hey @emilgoldsmith I was just reminded of Python Runtime type annotaters, which watch the code run in production and generate static typing afterwards, e.g.: https://github.com/Instagram/MonkeyType Maybe could take them as inspiration for design and user experience? |
Thanks, I'll try looking into it! |
This is the spec we discussed internally in Aiden for Autosnaps. The first comment below here will be my original design issue created, the next @lingz's reply, and third my reply to that. After that any comments will be original to this issue
The text was updated successfully, but these errors were encountered: