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

Question: hasFinalState + immutable.js = ❤️ ? #386

Open vandriesh opened 2 years ago

vandriesh commented 2 years ago

Question: any plans to expect adjust hasFinalState to consider immutable.js based state or give a possibility to transform state e.g.

    ...
    .hasFinalState((state) => state.getIn(['x','y]) === 'yyy)
    ...

e.g. now it looks like:

SagaTestError: 
Expected to have final store state:
-----------------------------------
Map {
  size: 1,
  _root: ArrayMapNode { ownerID: OwnerID {}, entries: [ [ 'data', [Map] ] ] },
  __ownerID: undefined,
  __hash: undefined,
  __altered: false
}

But instead had final store state:
----------------------------------
Map {
  size: 1,
  _root: ArrayMapNode { ownerID: undefined, entries: [ [ 'data', [Map] ] ] },
  __ownerID: undefined,
  __hash: undefined,
  __altered: false
}