Closed brandonsturgeon closed 1 year ago
After writing some hook-based tests, I've come to the conclusion that the best way to deal with this issue is to just add hooks, call hooks, and clean up any mess you made after the test completes.
(i'll still be pushing some changes that might address this issue indirectly, though)
I imagine this is because a
stub
isn't a function, and all major hook libraries are going to run it throughisfunction
.This will probably be an issue elsewhere, too, where we need a
stub
to be a function but it fails type checks.I see three options:
isfunction
andtype
andTypeID
for the duration of each test?hook
env to wrap our stub in a holder function?I prefer wrapping the major type functions, just to be thorough, but unfortunately the base hook library localizes the type functions...
So I guess we can do the first two? For now I think I'll make our
hook
env wrap the stub in a holder function, with the understanding that you still can't do: