Jest Test Fails with `Effect.sleep`: Seeking Workaround

I have a small Jest test that fails when I use Effect.sleep. Is there a workaround to make it work?

  it.only('test Effect.sleep', async () => {
    const program = pipe(
      Effect.succeed(1),
      Effect.tap(() => Effect.sleep(1000))
    )

    const result = await pipe(program, Effect.runPromiseExit)

    expect(result).toEqual(Exit.succeed(1))
  })


Returns:

thrown: "Exceeded timeout of 10000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
Was this page helpful?