{"action":"created","issue":{"url":"https://api.github.com/repos/wallabyjs/public/issues/311","labels_url":"https://api.github.com/repos/wallabyjs/public/issues/311/labels{/name}","comments_url":"https://api.github.com/repos/wallabyjs/public/issues/311/comments","events_url":"https://api.github.com/repos/wallabyjs/public/issues/311/events","html_url":"https://github.com/wallabyjs/public/issues/311","id":113682433,"number":311,"title":"Setup configuration to multiple transpiled codebase","user":{"login":"kwonoj","id":1210596,"avatar_url":"https://avatars.githubusercontent.com/u/1210596?v=3","gravatar_id":"","url":"https://api.github.com/users/kwonoj","html_url":"https://github.com/kwonoj","followers_url":"https://api.github.com/users/kwonoj/followers","following_url":"https://api.github.com/users/kwonoj/following{/other_user}","gists_url":"https://api.github.com/users/kwonoj/gists{/gist_id}","starred_url":"https://api.github.com/users/kwonoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwonoj/subscriptions","organizations_url":"https://api.github.com/users/kwonoj/orgs","repos_url":"https://api.github.com/users/kwonoj/repos","events_url":"https://api.github.com/users/kwonoj/events{/privacy}","received_events_url":"https://api.github.com/users/kwonoj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-27T20:30:34Z","updated_at":"2015-10-29T01:21:57Z","closed_at":"2015-10-29T01:21:57Z","body":"Hi, I'm trying to setup wallaby on [this repo](https://github.com/kwonoj/RxJS) where it's build script is currently configured as below: \r\n\r\n```\r\n\"build_cjs\": \"... babel dist/es6 --out-dir dist/cjs --modules common --source-maps --loose all ...\",\r\n\"build_es6\": \"... tsc src/Rx.ts src/Rx.KitchenSink.ts --outDir dist/es6 --sourceMap --target ES6 -d\",\r\n```\r\n(full script can be fount at [package.json](https://github.com/kwonoj/RxJS/blob/master/package.json))\r\n\r\nDue to several reason, this repo takes typescript source file into es6 build first, then create commonjs result from es6 transpiled build. [Test cases](https://github.com/kwonoj/RxJS/tree/master/spec) are referencing final build of commonjs instead of es6.\r\n\r\nHow do I setup wallaby for this repo? I tried simple configuration such as beow (with atom plugin) but it wasn't successful.\r\n\r\n```\r\nmodule.exports = function (w) {\r\n  return {\r\n    files: [\r\n      'src/**/*.ts'\r\n    ],\r\n\r\n    tests: [\r\n      'spec/**/*-spec.js'\r\n    ],\r\n\r\n    compilers: {\r\n      'src/Rx.ts src/Rx.KitchenSink.ts': w.compilers.typeScript({\r\n        outDir: 'dist/es6',\r\n        sourceMap: true,\r\n        target: 2,\r\n        declaration: true,\r\n      })\r\n    }\r\n  };\r\n};\r\n```\r\n\r\nThanks in advance.\r\n "},"comment":{"url":"https://api.github.com/repos/wallabyjs/public/issues/comments/152046658","html_url":"https://github.com/wallabyjs/public/issues/311#issuecomment-152046658","issue_url":"https://api.github.com/repos/wallabyjs/public/issues/311","id":152046658,"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":"2015-10-29T01:21:57Z","updated_at":"2015-10-29T01:21:57Z","body":"So Jasmine for node is ready - https://github.com/wallabyjs/public/issues/21.\r\nRe RxJS config, was tricky because of:\r\n- tests depend on compiled JavaScript, while wallaby as you know works differently, it shows everything right in the original source code;\r\n- the multistep process they have and just trying to compile their TS to ES5 didn't work;\r\n- some of the tests seem to depend on other tests (so have to constraint workers count). \r\n\r\nbut eventually I managed to get it working, here is the config:\r\n\r\n``` JavaScript\r\n\r\nmodule.exports = wallaby => ({\r\n  files: [\r\n    'index.js',\r\n    'src/**/*.ts',\r\n    {pattern: 'spec/helpers/test-helper.js', instrument: false}\r\n  ],\r\n\r\n  tests: ['spec/**/*-spec.js'],\r\n\r\n  compilers: {\r\n    '**/*.ts': wallaby.compilers.typeScript({\r\n      module: 1,  // commonjs\r\n      target: 2,  // ES6\r\n      preserveConstEnums: true\r\n    })\r\n  },\r\n\r\n  preprocessors: {\r\n    '**/*.js': file => require('babel').transform(file.content, {sourceMap: true, loose: 'all'})\r\n  },\r\n\r\n  testFramework: 'jasmine',\r\n\r\n  env: {\r\n    type: 'node'\r\n  },\r\n\r\n  workers: {initial: 1, regular: 1},\r\n\r\n  bootstrap: function (w) {\r\n    // Remapping all require calls to `dist/cjs` right to `src`\r\n    var Module = require('module').Module;\r\n    if (!Module._originalRequire) {\r\n      var modulePrototype = Module.prototype;\r\n      Module._originalRequire = modulePrototype.require;\r\n      modulePrototype.require = function (filePath) {\r\n        return Module._originalRequire.call(this, filePath.replace('dist/cjs', 'src'));\r\n      };\r\n    }\r\n\r\n    // Global test helpers\r\n    require('./spec/helpers/test-helper');\r\n  }\r\n});\r\n```\r\n\r\nI'm planning to create a pull request to the original repo so that the repo contributors could use wallaby if they like."}}