Title: [ng test] When code-coverage is on, sourcemaps for non spec files show JS content instead of TS · Issue #7117 · angular/angular-cli · GitHub
Open Graph Title: [ng test] When code-coverage is on, sourcemaps for non spec files show JS content instead of TS · Issue #7117 · angular/angular-cli
X Title: [ng test] When code-coverage is on, sourcemaps for non spec files show JS content instead of TS · Issue #7117 · angular/angular-cli
Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.2.3 node: 8.1.4 os: darwin x64 @angular/animations: 4.3.1 @angular/common: 4.3.1 @a...
Open Graph Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.2.3 node: 8.1.4 os: darwin x64 @angular/ani...
X Description: Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.2.3 node: 8.1.4 os: darwin x64 @angular/...
Opengraph URL: https://github.com/angular/angular-cli/issues/7117
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ng test] When code-coverage is on, sourcemaps for non spec files show JS content instead of TS","articleBody":"\u003c!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION YOUR ISSUE MIGHT BE CLOSED WITHOUT INVESTIGATING\r\n-->\r\n### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [x] bug report -> please search issues before submitting\r\n- [ ] feature request\r\n```\r\n\r\n### Versions.\r\n\u003c!--\r\nOutput from: `ng --version`.\r\nIf nothing, output from: `node --version` and `npm --version`.\r\n Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)\r\n-->\r\n\r\n```\r\n@angular/cli: 1.2.3\r\nnode: 8.1.4\r\nos: darwin x64\r\n@angular/animations: 4.3.1\r\n@angular/common: 4.3.1\r\n@angular/compiler: 4.3.1\r\n@angular/core: 4.3.1\r\n@angular/forms: 4.3.1\r\n@angular/http: 4.3.1\r\n@angular/platform-browser: 4.3.1\r\n@angular/platform-browser-dynamic: 4.3.1\r\n@angular/router: 4.3.1\r\n@angular/cli: 1.2.3\r\n@angular/compiler-cli: 4.3.1\r\n@angular/language-service: 4.3.1\r\n```\r\n\r\n(Also tested on Windows 8.1 with Node 6)\r\n\r\n### Repro steps.\r\n\u003c!--\r\nSimple steps to reproduce this bug.\r\nPlease include: commands run, packages added, related code changes.\r\nA link to a sample repo would help too.\r\n-->\r\n\r\n```\r\nng new test-app\r\ncd test-app\r\n```\r\n\r\nGo to `app.component.ts`, and a constructor that looks like:\r\n\r\n```typescript\r\n constructor() {\r\n debugger;\r\n }\r\n```\r\n\r\nThen run `ng test --sourcemap`\r\n\r\nSwitch to Chrome test browser, click \"Debug\", open the devtools, refresh.\r\n\r\nObserve how the breakpoint shows right (you see the `class` that is `AppComponent`)\r\n\r\n\r\n\r\nNow, stop the test runner, and re-run the command adding `--code-coverage` to it.\r\nLike `ng test --sourcemap --code-coverage`\r\n\r\nAgain, switch to Chrome test browser, click \"Debug\", open the devtools, refresh.\r\n\r\nObserve how the breakpoint shows differently this time:\r\n\r\n(shown in the next section)\r\n\r\n### The log given by the failure.\r\n\u003c!-- Normally this include a stack trace and some more information. -->\r\n\r\nIn the test browser devtools, we see compiled JavaScript as the content of the TypeScript file, like:\r\n\r\n\r\n\r\n\r\n### Desired functionality.\r\n\u003c!--\r\nWhat would like to see implemented?\r\nWhat is the usecase?\r\n-->\r\n\r\nI'd like to be able to see the correct content of the files in sourcemaps, that is the TypeScript code, not the JavaScript code. Similar to the first screenshot when not using `--code-coverage`. I'd like `--code-coverage` to not cause this to break.\r\n\r\n### Mention any other details that might be useful.\r\n\u003c!-- Please include a link to the repo if this is related to an OSS project. -->\r\n\r\n- Note how the filename at the top of the source file tab and the sourcemaps comment at the end of the file content point to the TypeScript file not the JavaScript file!!\r\n There are 2 sourcemaps comments in the file though, and only happening in the file where the result is wrong.\r\n\r\n- This problem does NOT happen in the spec files!!\r\n I confirmed by adding `: AppComponent` to one of the tests. It's preserved (plus lambdas etc)\r\n \r\n\r\n- This was working in CLI 1.0.6 (the one that a project I was helping upgrade happened to be upgrading from, signaling the issue, not sure about other versions)","author":{"url":"https://github.com/Meligy","@type":"Person","name":"Meligy"},"datePublished":"2017-07-24T11:15:38Z","url":"https://github.com/angular/angular-cli/issues/7117"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8674b1e3-1679-207e-d475-aa623cfb0164 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A0B2:2679E9:2A9B508:38E19E3:6B01C7E1 |
| html-safe-nonce | 9b7f04a4222ccaaa6337b9c3afd9326ea61143a3302850b5dd059a5488785ecf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEIyOjI2NzlFOToyQTlCNTA4OjM4RTE5RTM6NkIwMUM3RTEiLCJ2aXNpdG9yX2lkIjoiNjQ5Mzc4ODQ5NjYxMDgzODQ5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 89cd0c0e7795256d3136699a54fc16423ba293f877ae67f756f3453bd03ad90f |
| hovercard-subject-tag | issue:245047696 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/7117/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d5818be98fa3bf30e94a95bb57b0c36c5b9d2bfd761dce114d1a0dc7068364f2/angular/angular-cli/issues/7117 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d5818be98fa3bf30e94a95bb57b0c36c5b9d2bfd761dce114d1a0dc7068364f2/angular/angular-cli/issues/7117 |
| og:image:alt | Bug Report or Feature Request (mark with an x) - [x] bug report -> please search issues before submitting - [ ] feature request Versions. @angular/cli: 1.2.3 node: 8.1.4 os: darwin x64 @angular/ani... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Meligy |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width