{"action":"closed","issue":{"url":"https://api.github.com/repos/wallabyjs/public/issues/1590","repository_url":"https://api.github.com/repos/wallabyjs/public","labels_url":"https://api.github.com/repos/wallabyjs/public/issues/1590/labels{/name}","comments_url":"https://api.github.com/repos/wallabyjs/public/issues/1590/comments","events_url":"https://api.github.com/repos/wallabyjs/public/issues/1590/events","html_url":"https://github.com/wallabyjs/public/issues/1590","id":309462290,"number":1590,"title":"Wallaby cannot find jest mapped module relative to <rootDir> in monorepo","user":{"login":"suchipi","id":1341513,"avatar_url":"https://avatars0.githubusercontent.com/u/1341513?v=4","gravatar_id":"","url":"https://api.github.com/users/suchipi","html_url":"https://github.com/suchipi","followers_url":"https://api.github.com/users/suchipi/followers","following_url":"https://api.github.com/users/suchipi/following{/other_user}","gists_url":"https://api.github.com/users/suchipi/gists{/gist_id}","starred_url":"https://api.github.com/users/suchipi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suchipi/subscriptions","organizations_url":"https://api.github.com/users/suchipi/orgs","repos_url":"https://api.github.com/users/suchipi/repos","events_url":"https://api.github.com/users/suchipi/events{/privacy}","received_events_url":"https://api.github.com/users/suchipi/received_events","type":"User","site_admin":false},"labels":[{"id":645070503,"url":"https://api.github.com/repos/wallabyjs/public/labels/configuration%20question","name":"configuration question","color":"d4c5f9","default":false},{"id":596831012,"url":"https://api.github.com/repos/wallabyjs/public/labels/solution%20suggested","name":"solution suggested","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-28T17:35:31Z","updated_at":"2018-03-29T16:48:26Z","closed_at":"2018-03-29T16:48:25Z","author_association":"NONE","body":"### Issue description or question\r\nI am using wallaby with the jest framework in a monorepo.\r\nMy wallaby config file and jest config (in my package.json) both reside in a path deeper than my editor's project root:\r\n\r\n```\r\npackages/\r\n  my-package/\r\n    wallaby.conf.js\r\n    package.json (contains jest config)\r\n```\r\n\r\nI use `<rootDir>` in my Jest config to refer to `packages/my-package`, and I have my jest `moduleNameMapper`s referring to content in `<rootDir>/..`.\r\n\r\nJest resolves those properly, but wallaby does not. I suspect (but have not confirmed) that wallaby is using the project root as `<rootDir>` instead of the location of `packages/my-package`.\r\n\r\nHere is the error I get from wallaby:\r\n```\r\nConfiguration error:\r\n\r\nCould not locate module react (mapped as ./../react-compat/index.js)\r\n\r\nPlease check:\r\n\r\n\"moduleNameMapper\": {\r\n  \"/^react$/\": \"./../react-compat/index.js\"\r\n},\r\n\"resolver\": undefined\r\n```\r\n\r\nI have also tried opening `my-package` directly in atom as the project root, but I get the same error.\r\n\r\n### Wallaby.js configuration file\r\n\r\n```javascript\r\nconst path = require(\"path\");\r\n\r\nmodule.exports = function(wallaby) {\r\n  return {\r\n    files: [\r\n      \"src/**/*.js?(x)\",\r\n      \"!src/**/*.test.js?(x)\",\r\n      \"!src/**/*.stories.js?(x)\",\r\n    ],\r\n\r\n    tests: [\r\n      \"src/**/*.test.js?(x)\",\r\n    ],\r\n\r\n    env: {\r\n      type: \"node\",\r\n      runner: \"node\",\r\n      params: {\r\n        env: `NODE_PATH=${path.resolve(__dirname, \"..\", \"..\", \"node_modules\")}`,\r\n      },\r\n    },\r\n\r\n    testFramework: \"jest\",\r\n\r\n    compilers: {\r\n      \"src/**/*.js?(x)\": wallaby.compilers.babel(),\r\n    },\r\n  };\r\n};\r\n```\r\n\r\n### Jest config (in `package.json`)\r\n```\r\n\"jest\": {\r\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/src/testHelpers/setup.js\",\r\n    \"testPathIgnorePatterns\": [\r\n      \"<rootDir>/node_modules/\",\r\n      \"<rootDir>/build/\"\r\n    ],\r\n    \"moduleNameMapper\": {\r\n      \"^react$\": \"<rootDir>/../react-compat/index.js\",\r\n      \"^react/lib/(.*)$\": \"<rootDir>/../../node_modules/react-15/lib/$1\"\r\n    }\r\n  }\r\n```\r\n\r\n### Code editor or IDE name and version\r\n\r\nAtom v1.24.0\r\natom-wallaby 1.0.22\r\n\r\n### OS name and version\r\n\r\nmacOS Sierra 10.12.6\r\n"}}
{"actor":{"display_login":"suchipi"}}