Problem using TestClock.setTime

I'm trying to use TestClock.setTime in my tests and I'm getting the following error:

 FAIL  handler/repro.spec.ts > testClockRepro > should set time
TypeError: testClock.setTime is not a function
 ❯ ../../node_modules/effect/src/TestClock.ts:534:5
 ❯ ../../node_modules/effect/dist/esm/TestClock.js:374:118
    345|  */
    346| export const currentTimeMillis = /*#__PURE__*/testClockWith(testClock => testClock.cu…
    347| //# sourceMappingURL=TestClock.js.map
       |            


Minimal reproduction:

import {describe, it} from 'vitest';
import {Effect} from 'effect';
import {setTime} from 'effect/TestClock';

describe('testClockRepro', () => {
  it('should set time', () =>
    Effect.gen(function* (_) {
      yield* _(setTime(10000));
    }).pipe(Effect.runPromise));
});


---

Am I doing it wrong or is there an issue with the TestClock?
Was this page helpful?