这是我正在测试的文件:
import { combineReducers } from 'redux';
import auth from './auth';
export default combineReducers({
auth
});
这是我要测试的代码:
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import * as api from '../../utilities/synergy-api';
import { combineReducers } from 'redux';
import auth from '../auth';
import * as types from '../../actions/types';
import * as actions from '../../actions/authActions';
const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);
test('combineReducers', () => {
expect(actions.auth).toBe('auth');
});
我收到一个错误,说明是字符串,但是收到了未定义的字符串。有谁知道如何解决这个问题?
答案 0 :(得分:0)
import * as actions from '../../actions/authActions';
应该是:
import actions from '../../actions/authActions';