{"action":"created","issue":{"url":"https://api.github.com/repos/stryker-mutator/stryker/issues/1120","repository_url":"https://api.github.com/repos/stryker-mutator/stryker","labels_url":"https://api.github.com/repos/stryker-mutator/stryker/issues/1120/labels{/name}","comments_url":"https://api.github.com/repos/stryker-mutator/stryker/issues/1120/comments","events_url":"https://api.github.com/repos/stryker-mutator/stryker/issues/1120/events","html_url":"https://github.com/stryker-mutator/stryker/issues/1120","id":355682477,"node_id":"MDU6SXNzdWUzNTU2ODI0Nzc=","number":1120,"title":"Fails to run with TypeScript transpilation enabled and includes specified in tsconfig.json","user":{"login":"severen","id":4061736,"node_id":"MDQ6VXNlcjQwNjE3MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/4061736?v=4","gravatar_id":"","url":"https://api.github.com/users/severen","html_url":"https://github.com/severen","followers_url":"https://api.github.com/users/severen/followers","following_url":"https://api.github.com/users/severen/following{/other_user}","gists_url":"https://api.github.com/users/severen/gists{/gist_id}","starred_url":"https://api.github.com/users/severen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/severen/subscriptions","organizations_url":"https://api.github.com/users/severen/orgs","repos_url":"https://api.github.com/users/severen/repos","events_url":"https://api.github.com/users/severen/events{/privacy}","received_events_url":"https://api.github.com/users/severen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-30T17:28:41Z","updated_at":"2018-08-31T12:56:21Z","closed_at":null,"author_association":"NONE","body":"### Summary\r\n\r\nStryker fails to run when I have transpilation enabled for TypeScript files _and_ the `include` field set in `tsconfig.json` (which is `\"include\": [\"./src\"]` in my case). It functions fine when I remove that (ignoring my issue in #1119).\r\n\r\n### TypeScript Config\r\n\r\n```json\r\n{\r\n  \"compilerOptions\": {\r\n    \"target\": \"esnext\",\r\n    \"module\": \"commonjs\",\r\n    \"moduleResolution\": \"node\",\r\n    \"lib\": [\"es2015\", \"es2016\", \"es2017\"],\r\n    \"jsx\": \"react\",\r\n    \"experimentalDecorators\": true,\r\n    \"esModuleInterop\": true,\r\n    \"skipLibCheck\": true,\r\n    \"strict\": true,\r\n    \"noUnusedLocals\": true,\r\n    \"noUnusedParameters\": true,\r\n    \"noImplicitThis\": true,\r\n    \"noImplicitAny\": true,\r\n    \"noImplicitReturns\": true,\r\n    \"typeRoots\": [\"./node_modules/@types\", \"./@types\"]\r\n  },\r\n  \"include\": [\"./src\"]\r\n}\r\n```\r\n\r\n### Stryker Config\r\n\r\n```js\r\nmodule.exports = (config) => {\r\n  config.set({\r\n    testRunner: 'jest',\r\n    mutate: ['src/**/*.ts'],\r\n    mutator: 'typescript',\r\n    transpilers: ['typescript'],\r\n    tsconfigFile: 'tsconfig.json',\r\n    packageManager: 'yarn',\r\n    // Currently does not work with Jest.\r\n    coverageAnalysis: 'off',\r\n    reporters: ['clear-text', 'progress', 'html'],\r\n  });\r\n};\r\n```\r\n\r\n### Stryker Environment\r\n\r\n```\r\n+-- stryker@0.29.1\r\n+-- stryker-api@0.21.0\r\n+-- stryker-jest-runner@1.2.0\r\n+-- stryker-typescript@0.13.2\r\n+-- jest@23.5.0\r\n+-- typescript@3.0.3\r\n```\r\n\r\n### Your Environment\r\n\r\n| software         | version(s)\r\n| ---------------- | -------  \r\n| node             | 10.9.0\r\n| yarn             | 1.9.4\r\n| Operating System | Arch Linux (packages updated 2018-08-31)\r\n\r\n### stryker.log\r\n\r\n[stryker.log](https://github.com/stryker-mutator/stryker/files/2337231/stryker.log)\r\n"},"comment":{"url":"https://api.github.com/repos/stryker-mutator/stryker/issues/comments/417655340","html_url":"https://github.com/stryker-mutator/stryker/issues/1120#issuecomment-417655340","issue_url":"https://api.github.com/repos/stryker-mutator/stryker/issues/1120","id":417655340,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzY1NTM0MA==","user":{"login":"severen","id":4061736,"node_id":"MDQ6VXNlcjQwNjE3MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/4061736?v=4","gravatar_id":"","url":"https://api.github.com/users/severen","html_url":"https://github.com/severen","followers_url":"https://api.github.com/users/severen/followers","following_url":"https://api.github.com/users/severen/following{/other_user}","gists_url":"https://api.github.com/users/severen/gists{/gist_id}","starred_url":"https://api.github.com/users/severen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/severen/subscriptions","organizations_url":"https://api.github.com/users/severen/orgs","repos_url":"https://api.github.com/users/severen/repos","events_url":"https://api.github.com/users/severen/events{/privacy}","received_events_url":"https://api.github.com/users/severen/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T12:56:21Z","updated_at":"2018-08-31T12:56:21Z","author_association":"NONE","body":"Something else worth noting is that I am using Jest with ts-jest and have the following configuration:\r\n\r\n```js\r\nmodule.exports = {\r\n  testEnvironment: 'node',\r\n\r\n  transform: { '^.+\\\\.tsx?$': 'ts-jest' },\r\n  testRegex: '(/__tests__/.*|\\\\.(test|spec))\\\\.(jsx?|tsx?)$',\r\n  moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'],\r\n\r\n  globals: {\r\n    'ts-jest': {\r\n      'use-babelrc': true,\r\n      enableTsDiagnostics: true,\r\n    },\r\n  },\r\n\r\n  coverageThreshold: {\r\n    global: {\r\n      // branches: 90,\r\n      functions: 95,\r\n      lines: 95,\r\n      statements: 95,\r\n    },\r\n  },\r\n  coveragePathIgnorePatterns: ['/node_modules/', '/test/'],\r\n};\r\n```\r\n\r\nI've also done some more investigation by poking around in the sandbox directory Stryker makes, and it seems that the TypeScript in my src directory is _already_ being transpiled by something else (ts-jest?) _before_ Stryker runs TypeScript on the code itself. So when TypeScript _does_ get to running on `./src`, it errors due to the fact that it cannot locate any TypeScript files to transpile. When I remove `\"include\": [\"./src\"]`, TypeScript defaults to compiling the entire project directory, which means it can successfully find *some* TypeScript files to transpile, albeit my tests and fixtures, which shouldn't be transpiled."}}
{"actor":{"display_login":"severen"}}