Effect CommunityEC
Effect Community3y ago
22 replies
joystick

Proper Assertion for Throwing Error in Effect.runSync

Hi good evening, how are you?

Could you please advise me on how shoudl I properly assert the following:
describe('running effects', () => {
  it('runSync throws on fail', () => {
    const pitcher = (): never => Effect.runSync(Effect.fail('bla'))
    const ball = new Error('bla') // ❓
    expect(pitcher).to.throw(ball)
  })
})

Thank you 🙏
Was this page helpful?