Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: saga.next is not a function #1

Open
lucaspereirasouzat opened this issue Jan 18, 2021 · 0 comments
Open

TypeError: saga.next is not a function #1

lucaspereirasouzat opened this issue Jan 18, 2021 · 0 comments

Comments

@lucaspereirasouzat
Copy link

`import runSaga from 'redux-saga-jest';
import { loadEmailRequest } from 'store/ducks/authentication/actions';

describe('simpleGenerator', () => {
const { it, expect } = runSaga(
loadEmailRequest('[email protected]'),
);

it('should yield 1', ({ value }: any) => {
console.log(value);

expect(value).toBe();

});

// it('then should yield 2', ({ value }) => {
// expect(value).toBe(2);
// });

it('then should finish', ({ value, done }: any) => {
console.log(value, done);

expect(value).toBeUndefined();
expect(done).toBe(true);

});
});`

Error
` FAIL tests/App-test.tsx
simpleGenerator
✕ should yield 1 (2ms)
✕ then should finish

● simpleGenerator › should yield 1

TypeError: saga.next is not a function

  at restartGenerator (node_modules/redux-saga-jest/dist/runSaga.js:12:53)
  at testMiddleware (node_modules/redux-saga-jest/dist/runSaga.js:37:20)

● simpleGenerator › then should finish

TypeError: saga.next is not a function

  at restartGenerator (node_modules/redux-saga-jest/dist/runSaga.js:12:53)
  at testMiddleware (node_modules/redux-saga-jest/dist/runSaga.js:37:20)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant