jfairbank / redux-saga-test-plan

Test Redux Saga with an easy plan.
http://redux-saga-test-plan.jeremyfairbank.com
MIT License
1.25k stars 127 forks source link

RunResult is not exported #344

Open gummybuns opened 4 years ago

gummybuns commented 4 years ago

Looking at the type definitions, the RunResult is not an importable interface. Im wondering if this was done for a specific reason or if the reason is no one asked for it yet!

I am using Jest and hoping to add custom expectations in typescript based on the return value of expectSaga.run()

expect.extend({
  toPassMyCustomCheck(result: RunResult) {
    // ...
  },
});

test('my custom check', async () => {
  const result: RunResult = await expectSaga(mySaga).run();
  expect(result).toPassMyCustomCheck();
});

I would be very happy to open a quick pr to export the RunResult if there is no reason not to.