Import react components with absolute path
问题 Here is my test file // /imports/components/main.test.js import React from 'react' import { shallow, mount } from 'enzyme' import Main from './main' import TextInput from "/imports/ui/textInput" ... and the main.js has // /imports/components/main.js import { action1 } from "/imports/actions/myAction" but it throws an error when I run the test, saying Cannot find module '/imports/actions/myAction' from 'main.js' If I comment the import './main' , same thing happen with importing TextInput. I