UNPKG

@tbowmo/node-red-small-timer

Version:

Small timer node for Node-RED with support for sunrise, sunset etc. timers

22 lines (16 loc) 407 B
import { createSandbox } from 'sinon' import * as fakeTimers from '@sinonjs/fake-timers' const clock: fakeTimers.Clock = fakeTimers.install() export const useSinonSandbox = () => { const sandbox = createSandbox() afterEach(() => { clock.setSystemTime(0) sandbox.restore() }) return { ...sandbox, get clock() { return clock }, } }