rescript-vitest
rescript-vitest copied to clipboard
unbound vi utility functions
Noticed a few of these are not bound yet and started working on adding them:
-
vi.advanceTimersByTimeAsync
-
vi.advanceTimersToNextTimerAsync
-
vi.getTimerCount
-
vi.clearAllTimers
-
vi.runAllTicks
-
vi.runAllTimersAsync
-
vi.runOnlyPendingTimers
-
vi.runOnlyPendingTimersAsync
-
vi.getRealSystemTime
-
vi.getMockedSystemTime
-
vi.setSystemTime
-
vi.isFakeTimers
-
vi.waitFor
-
vi.waitUntil
-
vi.hoisted
-
vi.resetConfig
Current work is in this draft PR
@cometkim I forgot to follow up with you on this--I have these bound in this branch
but I see that in #6 you did not want to bind to the vi
import. It's been a while since I looked at this but I remember there being an issue with the private vi_obj
being used when I was testing this on an example project.
Would you still like to use the vi_obj
private style bindings or are you ok with the zero-cost style?
I see many contributors constantly mentioning binding style. It won't be zero-cost bindings, regardless of whether or not we use functors. I'm willing to accept additional runtime to fit the ReScript model.
Functors are important because I plan to add more interfaces based on it in the future. Vitest has something like test context, which should be "configurable" by users. And the functors is perfect-fit here.