我正在开发一个在React/Redux/Webpack中工作的Web应用程序,现在我开始将测试与Mocha集成.
我按照Redux文档中的编写测试说明进行操作,但现在我遇到了webpack别名的问题.
例如,请查看我的一个动作创建者的此测试的导入部分:
import expect from 'expect' // resolves without an issue
import * as actions from 'actions/app'; // can't resolve this alias
import * as types from 'constants/actionTypes'; // can't resolve this alias
describe('Actions', () => {
describe('app',() => {
it('should create an action with a successful connection', () => {
const host = '***************',
port = ****,
db = '******',
user = '*********',
pass = '******';
const action = actions.createConnection(host, port, db, user, pass);
const expectedAction …Run Code Online (Sandbox Code Playgroud)