我正在用Jest模块编写一些简单的单元测试:
import { addExpense, removeExpense, editExpense } from '../../actions/expenses';
test('should setup remove expense action object', () => {
const id = '148579';
const action = removeExpense({ id });
expect(action).toEqual({
type: 'REMOVE_EXPENSE',
id
});
});
Jest向我提出了以下错误:
Test suite failed to run
/Users/ferranblanchexandri/Desktop/Coding/ReactCourse/expensify-app/src/tests/actions/expenses.test.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { addExpense, removeExpense, editExpense } from '../../actions/expenses';
^^^^^^
SyntaxError: Unexpected token import