{"action":"created","issue":{"url":"https://api.github.com/repos/wallabyjs/public/issues/866","repository_url":"https://api.github.com/repos/wallabyjs/public","labels_url":"https://api.github.com/repos/wallabyjs/public/issues/866/labels{/name}","comments_url":"https://api.github.com/repos/wallabyjs/public/issues/866/comments","events_url":"https://api.github.com/repos/wallabyjs/public/issues/866/events","html_url":"https://github.com/wallabyjs/public/issues/866","id":188979907,"number":866,"title":"TS, Webpack.ProvidePlugin and es6 promises","user":{"login":"mtrivolli","id":16635831,"avatar_url":"https://avatars.githubusercontent.com/u/16635831?v=3","gravatar_id":"","url":"https://api.github.com/users/mtrivolli","html_url":"https://github.com/mtrivolli","followers_url":"https://api.github.com/users/mtrivolli/followers","following_url":"https://api.github.com/users/mtrivolli/following{/other_user}","gists_url":"https://api.github.com/users/mtrivolli/gists{/gist_id}","starred_url":"https://api.github.com/users/mtrivolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtrivolli/subscriptions","organizations_url":"https://api.github.com/users/mtrivolli/orgs","repos_url":"https://api.github.com/users/mtrivolli/repos","events_url":"https://api.github.com/users/mtrivolli/events{/privacy}","received_events_url":"https://api.github.com/users/mtrivolli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-13T16:41:21Z","updated_at":"2016-11-14T00:26:06Z","closed_at":null,"body":"### Issue description or question\r\nHello, I'm trying to create a simple environment with typescript and webpack using es6 promises (see https://github.com/mtrivolli/webpack-ts). The es6-promise module is loaded with the help of webpack.ProvidePlugin:\r\n\r\n```javascript\r\n   plugins: [\r\n        new webpack.ProvidePlugin({\r\n            'Promise': 'es6-promise'\r\n        }),\r\n    ],\r\n```\r\n\r\nHowever, wallaby does not seem to work with this plugin: my test returns \"ReferenceError: Can't find variable: Promise\"\r\n\r\nI guess I should load the es6-promise polyfill via the wallaby config file, but after many unsuccessful attempts I've decided to ask for some help.\r\n\r\nThanks in advance\r\n\r\n### Wallaby.js configuration file\r\n```javascript\r\nvar webpackConfig = require(\"./webpack.config\");\r\nwebpackConfig.resolve.extensions = ['', '.js', '.json']; // anything you need but .ts extension\r\nwebpackConfig.module.loaders = [];\r\n\r\nvar wallabyWebpack = require('wallaby-webpack');\r\nvar webpackPostprocessor = wallabyWebpack(wallabyWebpack);\r\n\r\nmodule.exports = function (wallaby) {\r\n  return {\r\n    // set `load: false` to all source files and tests processed by webpack\r\n    // (except external files),\r\n    // as they should not be loaded in browser,\r\n    // their wrapped versions will be loaded instead\r\n    files: [\r\n      // {pattern: 'lib/jquery.js', instrument: false},\r\n      {pattern: 'src/**/*.ts', load: false},\r\n      //{pattern: 'node_modules/es6-promise/auto.js', instrument: false},\r\n    ],\r\n\r\n    tests: [\r\n      {pattern: 'test/**/*.ts', load: false}\r\n    ],\r\n    postprocessor: webpackPostprocessor,\r\n    debug: true,\r\n\r\n    setup: function () {\r\n      //require('es6-promise').polyfill();\r\n      window.__moduleBundler.loadTests();\r\n    }\r\n  };\r\n};\r\n```\r\n\r\n### Webpack configuration file\r\n```javascript\r\nvar webpack = require('webpack');\r\n\r\nvar config = {\r\n    entry: \"./src/index.tsx\",\r\n    output: {\r\n        filename: \"bundle.js\",\r\n        path: __dirname + \"/dist\"\r\n    },\r\n    watch: true,\r\n    // Enable sourcemaps for debugging webpack's output.\r\n    devtool: \"source-map\",\r\n\r\n    resolve: {\r\n        // Add '.ts' and '.tsx' as resolvable extensions.\r\n        extensions: [\"\", \".webpack.js\", \".web.js\", \".ts\", \".tsx\", \".js\"]\r\n    },\r\n\r\n    module: {\r\n        loaders: [\r\n            // All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.\r\n            { test: /\\.tsx?$/, loader: \"ts-loader\" }\r\n        ],\r\n\r\n        preLoaders: [\r\n            // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.\r\n            { test: /\\.js$/, loader: \"source-map-loader\" }\r\n        ]\r\n    },\r\n\r\n    plugins: [\r\n        new webpack.ProvidePlugin({\r\n            'Promise': 'es6-promise'\r\n        }),\r\n    ],\r\n\r\n    // When importing a module whose path matches one of the following, just\r\n    // assume a corresponding global variable exists and use that instead.\r\n    // This is important because it allows us to avoid bundling all of our\r\n    // dependencies, which allows browsers to cache those libraries between builds.\r\n    externals: {\r\n        \"react\": \"React\",\r\n        \"react-dom\": \"ReactDOM\"\r\n    },\r\n};\r\n\r\n\r\nmodule.exports = config;\r\n```\r\n### Code editor or IDE name and version\r\nVisual Studio Code v0.10.x\r\n\r\n### OS name and version\r\nLinux Debian 4.6.3\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/wallabyjs/public/issues/comments/260224698","html_url":"https://github.com/wallabyjs/public/issues/866#issuecomment-260224698","issue_url":"https://api.github.com/repos/wallabyjs/public/issues/866","id":260224698,"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-11-14T00:26:06Z","updated_at":"2016-11-14T00:26:06Z","body":"Thanks for the repo and config files.\r\nThe issue is that you're passing \r\n"}}
{"actor":{"display_login":"ArtemGovorov"}}