3 ms·
I suppose you'd have to use spec/assert for every instance of destructuring or "get" or "get-in" to avoid common mistakes. That's a lot of asserts everywhere.
by hellofunk 9y ago
I suppose you'd have to use spec/assert for every instance of destructuring or "get" or "get-in" to avoid common mistakes. That's a lot of asserts everywhere.
- DigitalJack 9y agoI don't understand this comment. I spec types, and then I spec functions that need that type. But not all the function, just the heavy use ones. I usually don't instrument the spec'd functions unless I'm actively debugging. edit: after having a minute to think on it, do you mean to catch a typo in the use of get, get-in, etc? I haven't tried that. I suppose you could wrap get, get-in with a nil check or something.
- hellofunk 9y ago> I suppose you could wrap get, get-in with a nil check or something. Indeed I suppose the solution would be write wrappers around common getters that allow you to pass a spec to the query and have them automatically assert that everything is what you expect.