【发布时间】:2016-02-21 01:10:16
【问题描述】:
测试此功能的最佳方法是什么
export function receivingItems() {
return (dispatch, getState) => {
axios.get('/api/items')
.then(function(response) {
dispatch(receivedItems(response.data));
});
};
}
这是我目前拥有的
describe('Items Action Creator', () => {
it('should create a receiving items function', () => {
expect(receivingItems()).to.be.a.function;
});
});
【问题讨论】:
标签: javascript unit-testing redux redux-thunk