{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/269","labels_url":"https://api.github.com/repos/facebook/jest/issues/269/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/269/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/269/events","html_url":"https://github.com/facebook/jest/issues/269","id":58690803,"number":269,"title":"Ignoring config.rootDir when looking for a module","user":{"login":"binarykitchen","id":177641,"avatar_url":"https://avatars.githubusercontent.com/u/177641?v=3","gravatar_id":"","url":"https://api.github.com/users/binarykitchen","html_url":"https://github.com/binarykitchen","followers_url":"https://api.github.com/users/binarykitchen/followers","following_url":"https://api.github.com/users/binarykitchen/following{/other_user}","gists_url":"https://api.github.com/users/binarykitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/binarykitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binarykitchen/subscriptions","organizations_url":"https://api.github.com/users/binarykitchen/orgs","repos_url":"https://api.github.com/users/binarykitchen/repos","events_url":"https://api.github.com/users/binarykitchen/events{/privacy}","received_events_url":"https://api.github.com/users/binarykitchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-24T04:04:06Z","updated_at":"2015-02-24T04:05:40Z","closed_at":null,"body":"Jest is unable to load a module in my test file `TimeZoneInput.test.coffee`:\r\n\r\n```\r\nError: /xxx/yyy/assets/portal/archiving/test/unit/components/form/TimeZoneInput.test.coffee: Cannot find module 'components/form/TimeZoneInput' from '/xxx/yyy/assets/portal/archiving/test/unit/components/form'\r\n```\r\n\r\nAt the top of that test file I have only this line:\r\n\r\n```coffee\r\njest.dontMock('components/form/TimeZoneInput')\r\n```\r\n\r\nJest fails to find this file. I have configured the `rootDir` as following\r\n\r\n```\r\n\"assets/portal/archiving\"\r\n```\r\n\r\nHere are my Jest options I am using in a gulp task:\r\n\r\n```coffee\r\njest(\r\n  rootDir:            \"assets/portal/archiving\"\r\n  scriptPreprocessor: \"test/unit/preprocessor.js\"\r\n  unmockedModulePathPatterns: [\r\n      \"node_modules/react\"\r\n  ]\r\n  testDirectoryName: \"test/unit\"\r\n  testFileExtensions: ['coffee']\r\n  moduleFileExtensions: [\r\n      \"coffee\"\r\n      \"cjsx\"\r\n  ]\r\n)\r\n```\r\n\r\nI expect Jest do load the module `'components/form/TimeZoneInput'` from within the given `rootDir` at `\"assets/portal/archiving\"` but it doesn't."},"comment":{"url":"https://api.github.com/repos/facebook/jest/issues/comments/75696188","html_url":"https://github.com/facebook/jest/issues/269#issuecomment-75696188","issue_url":"https://api.github.com/repos/facebook/jest/issues/269","id":75696188,"user":{"login":"binarykitchen","id":177641,"avatar_url":"https://avatars.githubusercontent.com/u/177641?v=3","gravatar_id":"","url":"https://api.github.com/users/binarykitchen","html_url":"https://github.com/binarykitchen","followers_url":"https://api.github.com/users/binarykitchen/followers","following_url":"https://api.github.com/users/binarykitchen/following{/other_user}","gists_url":"https://api.github.com/users/binarykitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/binarykitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binarykitchen/subscriptions","organizations_url":"https://api.github.com/users/binarykitchen/orgs","repos_url":"https://api.github.com/users/binarykitchen/repos","events_url":"https://api.github.com/users/binarykitchen/events{/privacy}","received_events_url":"https://api.github.com/users/binarykitchen/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T04:05:39Z","updated_at":"2015-02-24T04:05:39Z","body":"Furthermore my preprocessor file is\r\n\r\n```js\r\nvar ReactTools = require('react-tools'),\r\n    coffee     = require('coffee-script')\r\n\r\nmodule.exports = {\r\n  process: function(src, path) {\r\n\r\n    if (path.match(/\\.(coffee|cjsx)$/)) {\r\n      src = coffee.compile(src, {'bare': true})\r\n    }\r\n\r\n    return ReactTools.transform(src)\r\n  }\r\n}\r\n```\r\n\r\nand that `TimeZoneInput` component ends with `.cjsx`"}}