{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/2017","repository_url":"https://api.github.com/repos/facebook/jest","labels_url":"https://api.github.com/repos/facebook/jest/issues/2017/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/2017/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/2017/events","html_url":"https://github.com/facebook/jest/issues/2017","id":185757469,"number":2017,"title":"Does not work with requireindex","user":{"login":"xjamundx","id":246143,"avatar_url":"https://avatars.githubusercontent.com/u/246143?v=3","gravatar_id":"","url":"https://api.github.com/users/xjamundx","html_url":"https://github.com/xjamundx","followers_url":"https://api.github.com/users/xjamundx/followers","following_url":"https://api.github.com/users/xjamundx/following{/other_user}","gists_url":"https://api.github.com/users/xjamundx/gists{/gist_id}","starred_url":"https://api.github.com/users/xjamundx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xjamundx/subscriptions","organizations_url":"https://api.github.com/users/xjamundx/orgs","repos_url":"https://api.github.com/users/xjamundx/repos","events_url":"https://api.github.com/users/xjamundx/events{/privacy}","received_events_url":"https://api.github.com/users/xjamundx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-27T19:22:35Z","updated_at":"2016-10-28T06:51:42Z","closed_at":"2016-10-28T06:51:42Z","body":"**Do you want to request a *feature* or report a *bug*?**\r\n\r\nBUG\r\n\r\n**What is the current behavior?**\r\n\r\nrequireindex does not work with jest\r\n\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can `npm install` and `npm test`.**\r\n\r\n```js\r\n// my.test.js\r\nvar requireindex = require('requireindex')\r\nvar x = requireindex('./jest')\r\nvar len = Object.keys(x).length\r\nvar assert = require('assert')\r\nassert.equal(len, 1)\r\n```\r\n\r\n```js\r\n// jest/one.js\r\nmodule.exports = {}\r\n```\r\n\r\n```sh\r\nnode my.test.js # no errors\r\n./node_modules/.bin/jest my.test.js # failure\r\n```\r\n**What is the expected behavior?**\r\n\r\n`requireindex` should work\r\n\r\n**Run Jest again with `--debug` and provide the full configuration it prints. Please mention your node and npm version and operating system.**\r\n\r\n```\r\n~/dev/paypal/p2pnodeweb (pr/jest-all-the-things-2) $ ./node_modules/.bin/jest --no-cache --debug --env node my.test.js \r\njest version = 16.0.2\r\ntest framework = jasmine2\r\nconfig = {\r\n  \"rootDir\": \"/Users/jamuferguson/dev/paypal/p2pnodeweb\",\r\n  \"name\": \"-Users-jamuferguson-dev-paypal-p2pnodeweb\",\r\n  \"setupFiles\": [\r\n    \"/Users/jamuferguson/dev/paypal/p2pnodeweb/node_modules/babel-polyfill/lib/index.js\"\r\n  ],\r\n  \"testRunner\": \"/Users/jamuferguson/dev/paypal/p2pnodeweb/node_modules/jest-jasmine2/build/index.js\",\r\n  \"testEnvironment\": \"/Users/jamuferguson/dev/paypal/p2pnodeweb/node_modules/jest-environment-node/build/index.js\",\r\n  \"scriptPreprocessor\": \"/Users/jamuferguson/dev/paypal/p2pnodeweb/node_modules/babel-jest/build/index.js\",\r\n  \"usesBabelJest\": true,\r\n  \"automock\": false,\r\n  \"bail\": false,\r\n  \"browser\": false,\r\n  \"cacheDirectory\": \"/var/folders/9d/p3qfw0g94yz7qh3z9dr4btwm391xgk/T/jest\",\r\n  \"clearMocks\": false,\r\n  \"coveragePathIgnorePatterns\": [\r\n    \"/node_modules/\"\r\n  ],\r\n  \"coverageReporters\": [\r\n    \"json\",\r\n    \"text\",\r\n    \"lcov\",\r\n    \"clover\"\r\n  ],\r\n  \"globals\": {},\r\n  \"haste\": {\r\n    \"providesModuleNodeModules\": []\r\n  },\r\n  \"mocksPattern\": \"__mocks__\",\r\n  \"moduleDirectories\": [\r\n    \"node_modules\"\r\n  ],\r\n  \"moduleFileExtensions\": [\r\n    \"js\",\r\n    \"json\",\r\n    \"jsx\",\r\n    \"node\"\r\n  ],\r\n  \"moduleNameMapper\": {},\r\n  \"modulePathIgnorePatterns\": [],\r\n  \"noStackTrace\": false,\r\n  \"notify\": false,\r\n  \"preset\": null,\r\n  \"preprocessorIgnorePatterns\": [\r\n    \"/node_modules/\"\r\n  ],\r\n  \"resetModules\": false,\r\n  \"testPathDirs\": [\r\n    \"/Users/jamuferguson/dev/paypal/p2pnodeweb\"\r\n  ],\r\n  \"testPathIgnorePatterns\": [\r\n    \"/node_modules/\"\r\n  ],\r\n  \"testRegex\": \"(/__tests__/.*|\\\\.(test|spec))\\\\.jsx?$\",\r\n  \"testURL\": \"about:blank\",\r\n  \"timers\": \"real\",\r\n  \"useStderr\": false,\r\n  \"verbose\": null,\r\n  \"watch\": false,\r\n  \"cache\": false,\r\n  \"watchman\": true,\r\n  \"testcheckOptions\": {\r\n    \"times\": 100,\r\n    \"maxSize\": 200\r\n  }\r\n}\r\njest-haste-map: duplicate manual mock found:\r\n  Module name: node-uuid\r\n  Duplicate Mock path: /Users/jamuferguson/dev/paypal/p2pnodeweb/public/js/__mocks__/node-uuid.js\r\nThis warning is caused by two manual mock files with the same file name.\r\nJest will use the mock file found in: \r\n/Users/jamuferguson/dev/paypal/p2pnodeweb/public/js/__mocks__/node-uuid.js\r\n Please delete one of the following two files: \r\n /Users/jamuferguson/dev/paypal/p2pnodeweb/tests/unit/__mocks__/node-uuid.js\r\n/Users/jamuferguson/dev/paypal/p2pnodeweb/public/js/__mocks__/node-uuid.js\r\n\r\n\r\n FAIL  ./my.test.js\r\n  ● Test suite failed to run\r\n\r\n    AssertionError: 0 == 1\r\n      \r\n      at Object.<anonymous> (my.test.js:5:8)\r\n      at process._tickCallback (node.js:369:9)\r\n\r\nTest Suites: 1 failed, 1 total\r\nTests:       0 total\r\nSnapshots:   0 total\r\nTime:        0.84s\r\nRan all test suites matching \"my.test.js\".\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/jest/issues/comments/256849367","html_url":"https://github.com/facebook/jest/issues/2017#issuecomment-256849367","issue_url":"https://api.github.com/repos/facebook/jest/issues/2017","id":256849367,"user":{"login":"cpojer","id":13352,"avatar_url":"https://avatars.githubusercontent.com/u/13352?v=3","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T06:51:42Z","updated_at":"2016-10-28T06:51:42Z","body":"We don't support this feature consciously in our require implementation. In the applications we create we would like to be able to statically analyze the dependency tree. Custom module resolution algorithms make this more complicated and require custom tooling. It also breaks `jest --watch` because we cannot reliably find out which tests should be run based on changed files. People have brought this up in the past and the conclusion has usually been that such extensions aren't great patterns."}}
{"actor":{"display_login":"cpojer"}}