Closed dokurocker closed 4 years ago
self-solving
export const parrot = (param) => {
return param;
}
export class Test {
foo: string;
constructor(foo) {
this.foo = foo;
}
*gen() {
const _this = yield call(parrot, this);
console.log(_this.foo);
}
}
describe('Test', () => {
test('Test.gen expectSaga', () => {
const test = new Test('hello');
expectSaga(test.gen)
.provide([matchers.fn.call(parrot), test])
.run();
});
});
I want to know a better way... Thanks!
Test class has generator method "gen".
gen executes expectSaga
error occurred
Is there any way to set this.foo ?