{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/870","repository_url":"https://api.github.com/repos/facebook/jest","labels_url":"https://api.github.com/repos/facebook/jest/issues/870/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/870/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/870/events","html_url":"https://github.com/facebook/jest/issues/870","id":146561484,"number":870,"title":"/scss/ in preprocessorIgnorePatterns has no effect","user":{"login":"doque","id":1480751,"avatar_url":"https://avatars3.githubusercontent.com/u/1480751?v=3","gravatar_id":"","url":"https://api.github.com/users/doque","html_url":"https://github.com/doque","followers_url":"https://api.github.com/users/doque/followers","following_url":"https://api.github.com/users/doque/following{/other_user}","gists_url":"https://api.github.com/users/doque/gists{/gist_id}","starred_url":"https://api.github.com/users/doque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doque/subscriptions","organizations_url":"https://api.github.com/users/doque/orgs","repos_url":"https://api.github.com/users/doque/repos","events_url":"https://api.github.com/users/doque/events{/privacy}","received_events_url":"https://api.github.com/users/doque/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-04-07T09:35:17Z","updated_at":"2017-03-14T22:04:42Z","closed_at":"2016-04-28T05:29:58Z","body":"We're using CSS modules in our React components, which are importing `.scss` files, like this:\n\n```\nimport styles from './ReviewFeedItem.scss';\n```\n\nTo ignore them when running jest, I've excluded `/scss/` from the module loader (or so I think):\n\n```\n// package.json\n\n\"preprocessorIgnorePatterns\": [\n  \"/scss/\"\n],\n```\n\nHowever, when running the tests, the module loader still tries (and fails) to parse the .scss file as javascript and yields this error:\n\n```\nRuntime Error\nSyntaxError: Unexpected token ILLEGAL in file 'src/components/navigation/Navigation.scss'.\n\nMake sure your preprocessor is set up correctly and ensure your 'preprocessorIgnorePatterns' configuration is correct: http://facebook.github.io/jest/docs/api.html#config-preprocessorignorepatterns-array-string\nIf you are currently setting up Jest or modifying your preprocessor, try `jest --no-cache`.\nPreprocessor: jest-preprocessor.js.\nJest tried to the execute the following preprocessed code:\nbody { height: 0; }\n```\n\nAny variation of the exclude Pattern, such as `\\\\.scss`, `scss` and so forth has no effect.\nWe're using `babel-jest` as the `scriptPreprocessor` (so no specific entry for that in package.json)\n"},"comment":{"url":"https://api.github.com/repos/facebook/jest/issues/comments/286575674","html_url":"https://github.com/facebook/jest/issues/870#issuecomment-286575674","issue_url":"https://api.github.com/repos/facebook/jest/issues/870","id":286575674,"user":{"login":"afraser","id":1179515,"avatar_url":"https://avatars2.githubusercontent.com/u/1179515?v=3","gravatar_id":"","url":"https://api.github.com/users/afraser","html_url":"https://github.com/afraser","followers_url":"https://api.github.com/users/afraser/followers","following_url":"https://api.github.com/users/afraser/following{/other_user}","gists_url":"https://api.github.com/users/afraser/gists{/gist_id}","starred_url":"https://api.github.com/users/afraser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afraser/subscriptions","organizations_url":"https://api.github.com/users/afraser/orgs","repos_url":"https://api.github.com/users/afraser/repos","events_url":"https://api.github.com/users/afraser/events{/privacy}","received_events_url":"https://api.github.com/users/afraser/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T22:04:42Z","updated_at":"2017-03-14T22:04:42Z","body":"Took me a while to get this to work for me because I thought the path was relative to the project. \r\n\r\nBelow works for me:\r\n```\r\n    \"modulePaths\": [\r\n      \"v2/app\"\r\n    ],\r\n    \"moduleNameMapper\": {\r\n      \".scss$\": \"SassStub.js\" // <-- lives in v2/app\r\n    },\r\n```\r\n\r\n__SassStub.js__\r\n```\r\nmodule.exports = {}\r\n```"}}
{"actor":{"display_login":"afraser"}}