{"action":"created","issue":{"url":"https://api.github.com/repos/wallabyjs/public/issues/642","repository_url":"https://api.github.com/repos/wallabyjs/public","labels_url":"https://api.github.com/repos/wallabyjs/public/issues/642/labels{/name}","comments_url":"https://api.github.com/repos/wallabyjs/public/issues/642/comments","events_url":"https://api.github.com/repos/wallabyjs/public/issues/642/events","html_url":"https://github.com/wallabyjs/public/issues/642","id":159565493,"number":642,"title":"Cannot read Cache and module not found react/lib/ExecutionEnvironment by enzyme","user":{"login":"maitriyogin","id":1764628,"avatar_url":"https://avatars.githubusercontent.com/u/1764628?v=3","gravatar_id":"","url":"https://api.github.com/users/maitriyogin","html_url":"https://github.com/maitriyogin","followers_url":"https://api.github.com/users/maitriyogin/followers","following_url":"https://api.github.com/users/maitriyogin/following{/other_user}","gists_url":"https://api.github.com/users/maitriyogin/gists{/gist_id}","starred_url":"https://api.github.com/users/maitriyogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maitriyogin/subscriptions","organizations_url":"https://api.github.com/users/maitriyogin/orgs","repos_url":"https://api.github.com/users/maitriyogin/repos","events_url":"https://api.github.com/users/maitriyogin/events{/privacy}","received_events_url":"https://api.github.com/users/maitriyogin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wallabyjs/public/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-06-10T06:11:26Z","updated_at":"2016-06-10T13:48:56Z","closed_at":"2016-06-10T13:48:05Z","body":"### Module not found react/lib/ExecutionEnvironment by enzyme\r\nHi,\r\nhaving a bit of bother with setting up wallaby in our react application.\r\nThe error I'm getting is this in the wallaby console\r\n```\r\nRuntime error: TypeError: Cannot read property 'cache' of undefined\r\n    at Object.<anonymous> (./src/adapters/__test__/aggregation_adapter.spec.js.wbp.js:1:85)\r\n\r\n```\r\n\r\nAnd then this in Failing tests \r\n```\r\nModuleNotFoundError: Module not found: Error: Cannot resolve module 'react/lib/ExecutionEnvironment' in ****/node_modules/enzyme/build\r\n\r\nTypeError: Cannot read property 'cache' of undefined\r\n\tat src/adapters/__test__/aggregation_adapter.spec.js:1\r\n```\r\nThis is happening for a bunch of tests but actually not all.\r\n\r\nIf I open a file and then it's test file in web storm I can see the grey squares both in the test and implementation.  Although in the test file the tooltip says that the code is uncovered ... Thought this was a bit strange as it's the test code..\r\n\r\nOur file structure is \r\n```\r\nsrc/**/*.js\r\nsrc/**/__tests__/*.spec.js\r\n```\r\nSo all our test files are postfixed with .spec and live in a __tests__\r\n\r\nAs you can see from the wallaby config I'v had to fiddle to get web pack section to look like our own webpack.config.\r\n### Wallaby.js configuration file\r\n\r\n```\r\nvar wallabyWebpack = require('wallaby-webpack');\r\nvar path = require('path');\r\n// Remove this when aws-sdk support webpack //\r\nconst awsPath = path.join('aws-sdk', 'dist', 'aws-sdk');\r\n\r\nvar wallabyPostprocessor = wallabyWebpack({\r\n  // webpack options, such as\r\n  // module: {\r\n  //   loaders: [...]\r\n  // },\r\n  // externals: { jquery: \"jQuery\" }\r\n  module: {\r\n    loaders: [\r\n      {\r\n        test: /\\.jsx?$/, exclude: /(node_modules|vendor|spec)/, loaders: ['babel']\r\n      },\r\n      {test: /\\.scss$/, loaders: ['style', 'css', 'autoprefixer', 'sass']},\r\n      {\r\n        test: /\\.css$/,\r\n        loader: 'style!css?modules',\r\n        exclude: /(node_modules\\/(c3|mapbox\\.js|leaflet\\.markercluster))/\r\n      },\r\n      {test: /\\.css$/, loaders: ['style', 'css'], include: /(node_modules\\/(c3|mapbox\\.js|leaflet\\.markercluster))/},\r\n      {test: /\\.(woff|woff2|eot|ttf|svg|png|jpg)$/, loader: 'file?name=dist/assets/[hash].[ext]'},\r\n      {test: /\\.json$/, loader: 'json'},\r\n      {test: require.resolve(awsPath), loader: 'exports?AWS'}\r\n    ],\r\n    noParse: /aws-sdk/\r\n  },\r\n  resolve: {\r\n    modulesDirectories: [\r\n      path.join(__dirname, 'node_modules'),\r\n      'node_modules', 'src'],\r\n    alias: {'aws-sdk': awsPath}\r\n  }\r\n});\r\n\r\n\r\nmodule.exports = function (wallaby) {\r\n  return {\r\n    files: [\r\n      {pattern: 'node_modules/babel-polyfill/dist/polyfill.js', instrument: false},\r\n      \"src/**/*.js\",\r\n      \"src/**/*.scss\",\r\n      \"src/assets/**/*.*\",\r\n      {pattern: 'src/**/*.spec.js', ignore: true},\r\n      'test/unit/test_helper.js'\r\n    ],\r\n    tests: [\r\n      \"src/**/*.spec.js\"\r\n    ],\r\n    postprocessor: wallabyPostprocessor,\r\n    compilers: {\r\n      'src/**/*.js': wallaby.compilers.babel(),\r\n      'test/unit/test_helper.js': wallaby.compilers.babel()\r\n    },\r\n    workers: {\r\n      initial: 6,\r\n      regular: 2\r\n    },\r\n\r\n    env: {\r\n      type: 'node', runner: 'node'\r\n    },\r\n\r\n    testFramework: 'mocha',\r\n\r\n    bootstrap: function bootstrap() {\r\n      require('./test/unit/test_helper'); // <-- it's in the `files` list, so you may just do that\r\n    },\r\n\r\n    setup: function () {\r\n      // required to trigger test loading\r\n      window.__moduleBundler.loadTests();\r\n    }\r\n  };\r\n};\r\n\r\n\r\n```\r\n\r\n### Code editor or IDE name and version\r\n\r\nWebStorm v16\r\n\r\n### OS name and version\r\nOSX 10.11.4\r\n\r\n### Node Version\r\nv6.0.2\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/wallabyjs/public/issues/comments/225186682","html_url":"https://github.com/wallabyjs/public/issues/642#issuecomment-225186682","issue_url":"https://api.github.com/repos/wallabyjs/public/issues/642","id":225186682,"user":{"login":"ArtemGovorov","id":979966,"avatar_url":"https://avatars.githubusercontent.com/u/979966?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtemGovorov","html_url":"https://github.com/ArtemGovorov","followers_url":"https://api.github.com/users/ArtemGovorov/followers","following_url":"https://api.github.com/users/ArtemGovorov/following{/other_user}","gists_url":"https://api.github.com/users/ArtemGovorov/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtemGovorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtemGovorov/subscriptions","organizations_url":"https://api.github.com/users/ArtemGovorov/orgs","repos_url":"https://api.github.com/users/ArtemGovorov/repos","events_url":"https://api.github.com/users/ArtemGovorov/events{/privacy}","received_events_url":"https://api.github.com/users/ArtemGovorov/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T13:48:56Z","updated_at":"2016-06-10T13:48:56Z","body":"Awesome, thanks for the update!"}}
{"actor":{"display_login":"ArtemGovorov"}}