Raathigesh / majestic

⚡ Zero config GUI for Jest
MIT License
7.49k stars 173 forks source link

Cannot find module './test.js' from 'index.js' #96

Open iGitScor opened 5 years ago

iGitScor commented 5 years ago

Hi,

Is this a bug report or a feature request?

Report a bug

Version Info

Reproduction Repo

In package.json, I have specific jest configuration

"jest": {
  "collectCoverage": false,
  "coverageDirectory": "./coverage/",
  "collectCoverageFrom": [
    "server/**/*.js",
    "!**/mocks/**",
    "!server/ui/**/*.js"
  ],
  "setupFiles": [
    "./setup.js"
  ],
  "setupTestFrameworkScriptFile": "./node_modules/jest-xml-matcher/index.js",
  "testMatch": [
    "<rootDir>/__tests__/**/*.spec.js?(x)"
  ],
  "transform": {
    ".(js)": "<rootDir>/node_modules/babel-jest"
  },
  "testEnvironment": "node",
  "testPathIgnorePatterns": [
    "<rootDir>/__tests__/__e2e__/*"
  ]
}

There are failing tests (not failing by launching jest directly)

  ● Test suite failed to run

    Cannot find module './test.js' from 'index.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:169:17)
      at Object.<anonymous> (server/config/environment/index.js:54:47)

When I launch the test using majestic with debug

ℹ Majestic configuration from Package.json:  {}                                                                                                                                           Config Resolver 08:00:38
ℹ Path of resolved Jest script:  /Users/me/dev/project/node_modules/jest                                                                                 Config Resolver 08:00:38
ℹ Resolved Majestic config : {                                                                                                                                                            Config Resolver 08:00:38
  jestScriptPath: '/Users/me/dev/project/node_modules/jest/bin/jest.js',
  args: [],
  env: {}
}
ℹ Watching file : /Users/me/dev/project/__tests__/routes.spec.js                                                                                            File watcher 08:00:52
ℹ Executing Jest with : [                                                                                                                                                                    Jest Manager 08:00:55
  '-r',
  '/Users/me/.nvm/versions/node/v10.14.1/lib/node_modules/majestic/dist/server/scripts/patch.js',
  '/Users/me/dev/project/node_modules/jest/bin/jest.js',
  '--colors',
  '--collectCoverage=false',
  '^.me.dev.project.__tests__.routes.spec.js$',
  '--reporters',
  'default',
  '/Users/me/.nvm/versions/node/v10.14.1/lib/node_modules/majestic/dist/server/scripts/reporter.js',
  '--verbose=false'
] {
  MAJESTIC_PORT: '4000',
  REPORT_SUMMARY: ''
}

Thank you

Raathigesh commented 5 years ago

Would you be able to provide a sample repo where this is reproducible?