import with jest error: Unexpected token import
问题 I've seen similar questions but still can't find a viable solution. I'm trying to integrate Jest into a working project, which uses import/export default in hundreds of places. The following test does work for Jest using require: const bar = require('../../flows/foo'); test('adds 1 + 2 to equal 3', () => { expect(bar.foobar(1, 2)).toBe(3); }); when export is: module.exports = { foobar: foobar, fizz: fizz } The functions I'll want to be testing however are exported using: export default {