当我运行Jest命令时,出现此错误,无法从“ Auth.js”中找到模块“ constants / ActionTypes”

时间:2019-11-26 16:37:04

标签: javascript reactjs redux jestjs

这是我的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`],
  }

这是错误的屏幕截图

enter image description here

0 个答案:

没有答案