【发布时间】:2017-12-16 04:39:12
【问题描述】:
我有一个调用另一个函数的函数
const getArtist = (id) => {
// builds params for other function
return otherFuntion(params);
}
我想验证当我调用getArtist(someValue) 时,otherFunction 会被正确的参数调用。
我怎样才能用玩笑来做到这一点?
describe('getArtist function', () => {
it('should call otherFunction with the right params', () => {
// how can I get a handle on the mock of otherFunction to see
// if it was called correctly ?
});
});
【问题讨论】:
标签: javascript reactjs jasmine jestjs