这是我的Auth.test.js文件
import * as actions from '../../src/appRedux/actions/Auth'
describe('ACTIONS', () => {
it('should create an action with correct type', () => {
const expectedAction = {
type: 'SIGNIN_USER'
}
expect(actions.userSignIn()).toEqual(expectedAction)
})
})
这是我的jest.config.js文件
module.exports = {
transform: {
"^.+\\.jsx?$": `<rootDir>/jest-preprocess.js`,
},
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
},
testPathIgnorePatterns: [`node_modules`, `.cache`, `public`],
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
globals: {
__PATH_PREFIX__: ``,
},
testURL: `http://localhost`,
setupFiles: [`<rootDir>/loadershim.js`],
}
这是错误的屏幕截图