You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
执行npm run test时报错:Error: call: argument fn is undefined or null
如下修改代码就正常了
importtestfrom'tape';// import { delay } from 'redux-saga'import{put,call,delay}from'redux-saga/effects'import{incrementAsync}from'./sagas'test('incrementAsync Saga test',(t)=>{constgenerator=incrementAsync()t.deepEqual(generator.next().value,// call(delay, 1000),delay(1000),'counter Saga must call delay(1000)')t.deepEqual(generator.next().value,put({type: 'INCREMENT'}),'counter Saga must dispatch an INCREMENT action')t.deepEqual(generator.next(),{done: true,value: undefined},'counter Saga must be done')t.end()});
The text was updated successfully, but these errors were encountered:
You shouldn't need to import delay from redux-saga/effects. Instead, make sure you are adding the export keyword before the "delay" defined in the sagas.js file. eg
执行npm run test时报错:Error: call: argument fn is undefined or null
如下修改代码就正常了
The text was updated successfully, but these errors were encountered: