SagaTestError: call expectation unmet:
See original GitHub issueHi, I am testing if a yield call has been executed. I receive this error which I probably misunderstand, but as far as I can tell the function is called with the same parameters in both the saga and the test file.
Does anyone know why the expectation is unmet?
Let me know if I need to post the saga/test suite.
` SagaTestError: call expectation unmet:
Expected
--------
{ '@@redux-saga/IO': true,
combinator: false,
type: 'CALL',
payload:
{ context: null,
fn:
{ [Function: mockConstructor]
_isMockFunction: true,
getMockImplementation: [Function],
mock: [Getter/Setter],
mockClear: [Function],
mockReset: [Function],
mockRestore: [Function],
mockReturnValueOnce: [Function],
mockResolvedValueOnce: [Function],
mockRejectedValueOnce: [Function],
mockReturnValue: [Function],
mockResolvedValue: [Function],
mockRejectedValue: [Function],
mockImplementationOnce: [Function],
mockImplementation: [Function],
mockReturnThis: [Function],
mockName: [Function],
getMockName: [Function] },
args: [ { user: [Object] } ] } }
Actual:
------
1. { '@@redux-saga/IO': true,
combinator: false,
type: 'CALL',
payload:
{ context: null,
fn:
{ [Function: mockConstructor]
_isMockFunction: true,
getMockImplementation: [Function],
mock: [Getter/Setter],
mockClear: [Function],
mockReset: [Function],
mockRestore: [Function],
mockReturnValueOnce: [Function],
mockResolvedValueOnce: [Function],
mockRejectedValueOnce: [Function],
mockReturnValue: [Function],
mockResolvedValue: [Function],
mockRejectedValue: [Function],
mockImplementationOnce: [Function],
mockImplementation: [Function],
mockReturnThis: [Function],
mockName: [Function],
getMockName: [Function] },
args: [ { user: [Object] } ] } }`
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
redux saga is returning SagaTestError: put expectation unmet ...
1 Answer 1 ; import { call, takeLatest, put } from 'redux-saga/effects' ; import { api } from './api' ; import { types...
Read more >Error Messages · GitBook - Redux Saga Test Plan
Error Messages. If a yielded effect and assertion effect call don't match, then the mock saga will throw an error showing the difference...
Read more >redux-saga-test-plan - Bountysource
I run test on saga, but on second call i have an error and i don't know what i need to do: SagaTestError:...
Read more >[Solved]-API call with saga not returning user data-Reactjs
Coding example for the question API call with saga not returning user ... saga is returning SagaTestError: put expectation unmet when checking api...
Read more >Redux Saga - Need help with testing task cancellation : r/reactjs
SagaTestError : call expectation unmet: Expected ... SagaTestError (node_modules/redux-saga-test-plan/lib/shared/SagaTestError.js:17:57) at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It would be cool if the serializer could show that the arguments serialize to the same string but have a different identity.
Sure, see the docs here: https://github.com/jfairbank/redux-saga-test-plan/blob/7f78a0742f94c67a221a9a1370b65f65e38b66b6/docs/integration-testing/partial-matching.md