ZenVoich / test

Motoko testing library to run tests with mops
MIT License
6 stars 3 forks source link

Timer support? #12

Open Gekctek opened 5 months ago

Gekctek commented 5 months ago

Is there a way I can run some code that will set a timer without an error? I have some code that kicks off a timer (dont care about it for the test) and i get this error FAIL internals:604:11: execution error, Value.prim: global_timer_set

Maybe some sort of mock, or just ignore the timer? what are my options

ZenVoich commented 5 months ago

I use a workaround for this. I expose a setTimers method which I call from my actor but not from my tests.

Gekctek commented 5 months ago

Hmm. Thats not really an option for me. I have a class that handles timers internally and so is abstracted out from the user Im assuming this is a non-trivial change. But im not sure what to do. For my testing, i just commented out the timers, but then turn them back on when not testing