{"action":"created","comment":{"url":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/comments/205718987","pull_request_review_id":141045121,"id":205718987,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTcxODk4Nw==","diff_hunk":"@@ -13,78 +15,55 @@ describe('get default ts config', () => {\n     getTSConfig.cache.clear();\n   });\n \n-  it('should correctly read tsconfig.json', () => {\n-    const result = getTSConfig(null);\n-\n-    expect(result).toEqual({\n-      declaration: false,\n-      declarationMap: false,\n-      emitDeclarationOnly: false,\n-      inlineSourceMap: true,\n-      inlineSources: true,\n-      target: ts.ScriptTarget.ES2015,\n-      module: ts.ModuleKind.CommonJS,\n-      moduleResolution: ts.ModuleResolutionKind.NodeJs,\n-      noEmitOnError: false,\n-      jsx: ts.JsxEmit.React,\n-    });\n-  });\n+  it('should bail when no default tsconfig.json found', () => {\n+    // there is no tsconfig file in that test module\n+    ((path as any) as MockedPath).__setBaseDir('./tests/jestconfig-test');\n \n-  it('should not read my-tsconfig.json', () => {\n-    const result = getTSConfig(null);\n-\n-    expect(result).not.toEqual({\n-      target: ts.ScriptTarget.ES2015,\n-      module: ts.ModuleKind.CommonJS,\n-      moduleResolution: ts.ModuleResolutionKind.NodeJs,\n-      noEmitOnError: true,\n-      jsx: ts.JsxEmit.React,\n-    });\n+    expect(() => getTSConfig(jestConfig.jestconfigTest(null))).toThrowError(\n+      /unable to find ts configuration file/i,\n+    );\n   });\n \n-  it('should not read inline tsconfig options', () => {\n-    const result = getTSConfig(null);\n+  it('should correctly read tsconfig.json', () => {\n+    const result = getTSConfig(jestConfig.tsconfigTest(null));\n \n-    expect(result).not.toEqual({\n-      module: ts.ModuleKind.CommonJS,\n-      jsx: ts.JsxEmit.React,\n-    });\n+    expect(result).toMatchSnapshot();\n   });\n \n   describe('new behavior (tsConfigFile & tsConfig)', () => {\n     it('should be same results for null/undefined/etc.', () => {\n-      const result = getTSConfig(null);\n-      const resultUndefinedParam = getTSConfig(undefined);\n-      const resultNullParam = getTSConfig(null);\n-      const resultEmptyParam = getTSConfig({});\n-      const resultUndefinedContentFile = getTSConfig({\n-        'ts-jest': { tsConfigFile: undefined },\n-      });\n-      const resultNullContentFile = getTSConfig({\n-        'ts-jest': { tsConfigFile: null },\n-      });\n-\n-      expect(result).toEqual(resultUndefinedParam);\n-      expect(result).toEqual(resultNullParam);\n+      const result = getTSConfig(jestConfig.tsconfigTest(null));\n+      const resultEmptyParam = getTSConfig(jestConfig.tsconfigTest({}));\n+      const resultUndefinedContentFile = getTSConfig(\n+        jestConfig.tsconfigTest({ tsConfigFile: undefined }),\n+      );\n+      const resultNullContentFile = getTSConfig(\n+        jestConfig.tsconfigTest({ tsConfigFile: null }),\n+      );\n+\n       expect(result).toEqual(resultEmptyParam);\n       expect(result).toEqual(resultUndefinedContentFile);\n       expect(result).toEqual(resultNullContentFile);\n     });\n \n     it('should be different results for different rootDir with same jest config.', () => {\n-      const rootConfig = getTSConfig({});\n-      const subConfig = getTSConfig({}, 'tsconfig-module');\n+      const rootConfig = getTSConfig(jestConfig.tsconfigTest());\n+      const subConfig = getTSConfig(\n+        jestConfig('tsconfig-test/tsconfig-module'),\n+      );\n       expect(rootConfig).not.toEqual(subConfig);\n     });\n \n     it('should not change the module if it is loaded from a non-default config file', () => {\n-      const config = getTSConfig({\n-        'ts-jest': {\n+      const config = getTSConfig(\n+        jestConfig.tsconfigTest({\n           tsConfigFile: 'tsconfig-module/custom-config.json',\n-        },\n-      });\n+        }),\n+      );\n \n+      // snapshot would be enough here, but that adds a security in case we do not see it in a PR\n       expect(config.module).toBe(ts.ModuleKind.ES2015);","path":"tests/__tests__/tsconfig-default.spec.ts","position":114,"original_position":114,"commit_id":"fbe4f1f37e6e2f51855bff1ffba552c6739dc7f1","original_commit_id":"fbe4f1f37e6e2f51855bff1ffba552c6739dc7f1","user":{"login":"huafu","id":1162602,"node_id":"MDQ6VXNlcjExNjI2MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/1162602?v=4","gravatar_id":"","url":"https://api.github.com/users/huafu","html_url":"https://github.com/huafu","followers_url":"https://api.github.com/users/huafu/followers","following_url":"https://api.github.com/users/huafu/following{/other_user}","gists_url":"https://api.github.com/users/huafu/gists{/gist_id}","starred_url":"https://api.github.com/users/huafu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huafu/subscriptions","organizations_url":"https://api.github.com/users/huafu/orgs","repos_url":"https://api.github.com/users/huafu/repos","events_url":"https://api.github.com/users/huafu/events{/privacy}","received_events_url":"https://api.github.com/users/huafu/received_events","type":"User","site_admin":false},"body":"Yup, but this is because @kulshekhar was concerned about us not seeing a snapshot change in a PR, like if we have done a `jest ... -u` and did not check the snapshot diff. Here it's a little test ahead that would fail anyway, even with the `-u`. It's a security in case we hadn't seen the diff of the related snapshot.","created_at":"2018-07-27T09:33:00Z","updated_at":"2018-07-27T09:33:00Z","html_url":"https://github.com/kulshekhar/ts-jest/pull/626#discussion_r205718987","pull_request_url":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/comments/205718987"},"html":{"href":"https://github.com/kulshekhar/ts-jest/pull/626#discussion_r205718987"},"pull_request":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626"}},"in_reply_to_id":205701377},"pull_request":{"url":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626","id":202474370,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNDc0Mzcw","html_url":"https://github.com/kulshekhar/ts-jest/pull/626","diff_url":"https://github.com/kulshekhar/ts-jest/pull/626.diff","patch_url":"https://github.com/kulshekhar/ts-jest/pull/626.patch","issue_url":"https://api.github.com/repos/kulshekhar/ts-jest/issues/626","number":626,"state":"open","locked":false,"title":"upgrade deps - coverage, caching and source-mapping fixes, ...","user":{"login":"huafu","id":1162602,"node_id":"MDQ6VXNlcjExNjI2MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/1162602?v=4","gravatar_id":"","url":"https://api.github.com/users/huafu","html_url":"https://github.com/huafu","followers_url":"https://api.github.com/users/huafu/followers","following_url":"https://api.github.com/users/huafu/following{/other_user}","gists_url":"https://api.github.com/users/huafu/gists{/gist_id}","starred_url":"https://api.github.com/users/huafu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huafu/subscriptions","organizations_url":"https://api.github.com/users/huafu/orgs","repos_url":"https://api.github.com/users/huafu/repos","events_url":"https://api.github.com/users/huafu/events{/privacy}","received_events_url":"https://api.github.com/users/huafu/received_events","type":"User","site_admin":false},"body":"What does this PR:\r\n\r\n- [x] ⬆️ upgrade `babel-core` => `@babel/core` and related modifications\r\n\r\n    This will hopefully resolves some issues related to incompatible versions between babel and jest\r\n\r\n- [x] ➖ `babel-plugin-istanbul` and `babel-plugin-jest`: dependencies => dev deps\r\n\r\n    Those are included automatically when adding `babel-jest` and we should leverage it to choose the correct versions. Plus it allows users to use their desired versions if necessary\r\n\r\n- [x] 🔨 uses `jest` core types\r\n- [x] 🐛 fixes some coverage issues\r\n- [x] 🐛 fixes line mapping issues #606 \r\n- [x] ⬆️ upgrades `typescript` and `tslint` to latest versions (dev deps)\r\n- [x] :bug: fixes caching issues (#524 and maybe others)\r\n\r\n     I first thought this was related to jest itself, but then saw how the cache key was created and read some issues in this repo. Now the content of package.json and babel config if any are included in the hash builder input.\r\n\r\n- [x] 🐛 fixes an issue when transforming html files that would contain `${...}` or backtilts (`)\r\n\r\n__Possibly__ related issues: #601, #614\r\n\r\nThose are breaking changes! It could still work (I've not tested it), but I expect that using this modules with babel < 7 might be broken now.\r\n\r\n---\r\n\r\nSome minor stuff to note:\r\n\r\n- removed js entry points in root, all are ts in `src/`, entry point is `index` there\r\n- refactored some files\r\n- dropped many types to use the ones provided by jest package\r\n- split tsconfig.json (one for editing and tests, another for build)\r\n- cleaned-up a tiny bit some package scripts","created_at":"2018-07-19T07:56:48Z","updated_at":"2018-07-27T09:33:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3536deda638d8d64f12157edab700d9c8a5791d8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626/commits","review_comments_url":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626/comments","review_comment_url":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kulshekhar/ts-jest/issues/626/comments","statuses_url":"https://api.github.com/repos/kulshekhar/ts-jest/statuses/fbe4f1f37e6e2f51855bff1ffba552c6739dc7f1","head":{"label":"huafu:feature/upgrade-babel-and-fix-tsconfig","ref":"feature/upgrade-babel-and-fix-tsconfig","sha":"fbe4f1f37e6e2f51855bff1ffba552c6739dc7f1","user":{"login":"huafu","id":1162602,"node_id":"MDQ6VXNlcjExNjI2MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/1162602?v=4","gravatar_id":"","url":"https://api.github.com/users/huafu","html_url":"https://github.com/huafu","followers_url":"https://api.github.com/users/huafu/followers","following_url":"https://api.github.com/users/huafu/following{/other_user}","gists_url":"https://api.github.com/users/huafu/gists{/gist_id}","starred_url":"https://api.github.com/users/huafu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huafu/subscriptions","organizations_url":"https://api.github.com/users/huafu/orgs","repos_url":"https://api.github.com/users/huafu/repos","events_url":"https://api.github.com/users/huafu/events{/privacy}","received_events_url":"https://api.github.com/users/huafu/received_events","type":"User","site_admin":false},"repo":{"id":140924548,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA5MjQ1NDg=","name":"ts-jest","full_name":"huafu/ts-jest","owner":{"login":"huafu","id":1162602,"node_id":"MDQ6VXNlcjExNjI2MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/1162602?v=4","gravatar_id":"","url":"https://api.github.com/users/huafu","html_url":"https://github.com/huafu","followers_url":"https://api.github.com/users/huafu/followers","following_url":"https://api.github.com/users/huafu/following{/other_user}","gists_url":"https://api.github.com/users/huafu/gists{/gist_id}","starred_url":"https://api.github.com/users/huafu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huafu/subscriptions","organizations_url":"https://api.github.com/users/huafu/orgs","repos_url":"https://api.github.com/users/huafu/repos","events_url":"https://api.github.com/users/huafu/events{/privacy}","received_events_url":"https://api.github.com/users/huafu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/huafu/ts-jest","description":"TypeScript preprocessor with sourcemap support for Jest","fork":true,"url":"https://api.github.com/repos/huafu/ts-jest","forks_url":"https://api.github.com/repos/huafu/ts-jest/forks","keys_url":"https://api.github.com/repos/huafu/ts-jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/huafu/ts-jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/huafu/ts-jest/teams","hooks_url":"https://api.github.com/repos/huafu/ts-jest/hooks","issue_events_url":"https://api.github.com/repos/huafu/ts-jest/issues/events{/number}","events_url":"https://api.github.com/repos/huafu/ts-jest/events","assignees_url":"https://api.github.com/repos/huafu/ts-jest/assignees{/user}","branches_url":"https://api.github.com/repos/huafu/ts-jest/branches{/branch}","tags_url":"https://api.github.com/repos/huafu/ts-jest/tags","blobs_url":"https://api.github.com/repos/huafu/ts-jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/huafu/ts-jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/huafu/ts-jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/huafu/ts-jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/huafu/ts-jest/statuses/{sha}","languages_url":"https://api.github.com/repos/huafu/ts-jest/languages","stargazers_url":"https://api.github.com/repos/huafu/ts-jest/stargazers","contributors_url":"https://api.github.com/repos/huafu/ts-jest/contributors","subscribers_url":"https://api.github.com/repos/huafu/ts-jest/subscribers","subscription_url":"https://api.github.com/repos/huafu/ts-jest/subscription","commits_url":"https://api.github.com/repos/huafu/ts-jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/huafu/ts-jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/huafu/ts-jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/huafu/ts-jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/huafu/ts-jest/contents/{+path}","compare_url":"https://api.github.com/repos/huafu/ts-jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/huafu/ts-jest/merges","archive_url":"https://api.github.com/repos/huafu/ts-jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/huafu/ts-jest/downloads","issues_url":"https://api.github.com/repos/huafu/ts-jest/issues{/number}","pulls_url":"https://api.github.com/repos/huafu/ts-jest/pulls{/number}","milestones_url":"https://api.github.com/repos/huafu/ts-jest/milestones{/number}","notifications_url":"https://api.github.com/repos/huafu/ts-jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/huafu/ts-jest/labels{/name}","releases_url":"https://api.github.com/repos/huafu/ts-jest/releases{/id}","deployments_url":"https://api.github.com/repos/huafu/ts-jest/deployments","created_at":"2018-07-14T07:07:55Z","updated_at":"2018-07-14T07:51:42Z","pushed_at":"2018-07-26T09:42:33Z","git_url":"git://github.com/huafu/ts-jest.git","ssh_url":"git@github.com:huafu/ts-jest.git","clone_url":"https://github.com/huafu/ts-jest.git","svn_url":"https://github.com/huafu/ts-jest","homepage":"","size":1437,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kulshekhar:master","ref":"master","sha":"6741e6336504ac3bafa155e26a1297e49772bd57","user":{"login":"kulshekhar","id":10780624,"node_id":"MDQ6VXNlcjEwNzgwNjI0","avatar_url":"https://avatars3.githubusercontent.com/u/10780624?v=4","gravatar_id":"","url":"https://api.github.com/users/kulshekhar","html_url":"https://github.com/kulshekhar","followers_url":"https://api.github.com/users/kulshekhar/followers","following_url":"https://api.github.com/users/kulshekhar/following{/other_user}","gists_url":"https://api.github.com/users/kulshekhar/gists{/gist_id}","starred_url":"https://api.github.com/users/kulshekhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kulshekhar/subscriptions","organizations_url":"https://api.github.com/users/kulshekhar/orgs","repos_url":"https://api.github.com/users/kulshekhar/repos","events_url":"https://api.github.com/users/kulshekhar/events{/privacy}","received_events_url":"https://api.github.com/users/kulshekhar/received_events","type":"User","site_admin":false},"repo":{"id":66944590,"node_id":"MDEwOlJlcG9zaXRvcnk2Njk0NDU5MA==","name":"ts-jest","full_name":"kulshekhar/ts-jest","owner":{"login":"kulshekhar","id":10780624,"node_id":"MDQ6VXNlcjEwNzgwNjI0","avatar_url":"https://avatars3.githubusercontent.com/u/10780624?v=4","gravatar_id":"","url":"https://api.github.com/users/kulshekhar","html_url":"https://github.com/kulshekhar","followers_url":"https://api.github.com/users/kulshekhar/followers","following_url":"https://api.github.com/users/kulshekhar/following{/other_user}","gists_url":"https://api.github.com/users/kulshekhar/gists{/gist_id}","starred_url":"https://api.github.com/users/kulshekhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kulshekhar/subscriptions","organizations_url":"https://api.github.com/users/kulshekhar/orgs","repos_url":"https://api.github.com/users/kulshekhar/repos","events_url":"https://api.github.com/users/kulshekhar/events{/privacy}","received_events_url":"https://api.github.com/users/kulshekhar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kulshekhar/ts-jest","description":"TypeScript preprocessor with sourcemap support for Jest","fork":false,"url":"https://api.github.com/repos/kulshekhar/ts-jest","forks_url":"https://api.github.com/repos/kulshekhar/ts-jest/forks","keys_url":"https://api.github.com/repos/kulshekhar/ts-jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kulshekhar/ts-jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kulshekhar/ts-jest/teams","hooks_url":"https://api.github.com/repos/kulshekhar/ts-jest/hooks","issue_events_url":"https://api.github.com/repos/kulshekhar/ts-jest/issues/events{/number}","events_url":"https://api.github.com/repos/kulshekhar/ts-jest/events","assignees_url":"https://api.github.com/repos/kulshekhar/ts-jest/assignees{/user}","branches_url":"https://api.github.com/repos/kulshekhar/ts-jest/branches{/branch}","tags_url":"https://api.github.com/repos/kulshekhar/ts-jest/tags","blobs_url":"https://api.github.com/repos/kulshekhar/ts-jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kulshekhar/ts-jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kulshekhar/ts-jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/kulshekhar/ts-jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kulshekhar/ts-jest/statuses/{sha}","languages_url":"https://api.github.com/repos/kulshekhar/ts-jest/languages","stargazers_url":"https://api.github.com/repos/kulshekhar/ts-jest/stargazers","contributors_url":"https://api.github.com/repos/kulshekhar/ts-jest/contributors","subscribers_url":"https://api.github.com/repos/kulshekhar/ts-jest/subscribers","subscription_url":"https://api.github.com/repos/kulshekhar/ts-jest/subscription","commits_url":"https://api.github.com/repos/kulshekhar/ts-jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/kulshekhar/ts-jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/kulshekhar/ts-jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/kulshekhar/ts-jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/kulshekhar/ts-jest/contents/{+path}","compare_url":"https://api.github.com/repos/kulshekhar/ts-jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kulshekhar/ts-jest/merges","archive_url":"https://api.github.com/repos/kulshekhar/ts-jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kulshekhar/ts-jest/downloads","issues_url":"https://api.github.com/repos/kulshekhar/ts-jest/issues{/number}","pulls_url":"https://api.github.com/repos/kulshekhar/ts-jest/pulls{/number}","milestones_url":"https://api.github.com/repos/kulshekhar/ts-jest/milestones{/number}","notifications_url":"https://api.github.com/repos/kulshekhar/ts-jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kulshekhar/ts-jest/labels{/name}","releases_url":"https://api.github.com/repos/kulshekhar/ts-jest/releases{/id}","deployments_url":"https://api.github.com/repos/kulshekhar/ts-jest/deployments","created_at":"2016-08-30T13:47:17Z","updated_at":"2018-07-27T07:06:20Z","pushed_at":"2018-07-26T09:42:35Z","git_url":"git://github.com/kulshekhar/ts-jest.git","ssh_url":"git@github.com:kulshekhar/ts-jest.git","clone_url":"https://github.com/kulshekhar/ts-jest.git","svn_url":"https://github.com/kulshekhar/ts-jest","homepage":"","size":1213,"stargazers_count":1085,"watchers_count":1085,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"archived":false,"open_issues_count":47,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":125,"open_issues":47,"watchers":1085,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626"},"html":{"href":"https://github.com/kulshekhar/ts-jest/pull/626"},"issue":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/issues/626"},"comments":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/issues/626/comments"},"review_comments":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626/comments"},"review_comment":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/pulls/626/commits"},"statuses":{"href":"https://api.github.com/repos/kulshekhar/ts-jest/statuses/fbe4f1f37e6e2f51855bff1ffba552c6739dc7f1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"huafu"}}