-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during remaping and sourcemap not found #41
Comments
+1, I'm seeing the same issue with both inline and sibling sourcemaps using TypeScript. edit: my inline sourcemaps are base64 encoded JSON, and clearly in the |
- using a shared loaders.js to reduce arcane list of loaders - add `istanbulInstrumenter` and use inline-source-maps to get coverage. However, this is covering transpiled code, not .ts on its own. - remap-istanbul should be taking care of this, but for some reason it is not finding the inline or sibling sourcemaps. reported in SitePen/remap-istanbul#33, SitePen/remap-istanbul#29, and SitePen/remap-istanbul#41
- using a shared loaders.js to reduce arcane list of loaders - add `istanbulInstrumenter` and use inline-source-maps to get coverage. However, this is covering transpiled code, not .ts on its own. - remap-istanbul should be taking care of this, but for some reason it is not finding the inline or sibling sourcemaps. reported in SitePen/remap-istanbul#33, SitePen/remap-istanbul#29, and SitePen/remap-istanbul#41
If you have the source map inlined inside the |
Correct, we don't currently support inline code, though the PR from @shaharmor will address this. |
Ok, sorry everyone it took me so long to get around to have time to focus on this. I adapted the PR from @shaharmor in commit b714254 including tests. I also realised that if there are inline sources in the source-map, that though should be copied out to the I think I handled the many to one file remapping for this, but I don't currently have any test cases that cover this, so milage may vary. After I do a few other things I will do a new release of the tool. |
Thanks for you work, I'll try this as soon as possible. |
Hi @kitsonk I try it and it's same problem for me on 0.6.3 version. |
@OlivierMary is there any way I can get an I notice it is using Gulp, I need to check if the Gulp plugin is properly passing the Instanbul MemoryStore that contains the sources. |
Hi @kitsonk you have all the information to reproduce on mgechev/angular-seed#716 It's easier if you reproduce from this seed ;) |
I am pretty sure I know what it is and how to fix it and will tomorrow AM my time. |
Actually, when I looked at it again, I realised that what I thought was broken was fixed (and there were test cases in place). I then clone the
So if the error persists, I don't thing you have |
@kitsonk did you change Without this change you can't reproduce ;) |
I copied exactly what you had in your example. It caused errors in karma and there were errors during the build.
I am afraid I cannot invest time in debugging all of that, but I did the best I could to copy your minimum reproduction example. But if a particular syntax causes an issue with remapped coverage and only that syntax, it is likely an issue with the generated source map not specifically matching back up properly to the sources. |
@kitsonk they change structure of project : import {Component, OnInit} from 'angular2/core';
import {CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/common';
import {NameListService} from '../../shared/index';
@Component({
selector: 'sd-home',
templateUrl: 'app/+home/components/home.component.html',
styleUrls: ['app/+home/components/home.component.css'],
directives: [FORM_DIRECTIVES, CORE_DIRECTIVES]
})
export class HomeComponent implements OnInit {
newName: string;
constructor(
public nameListService: NameListService) { }
ngOnInit() {
this.nameListService.get().filter(s=>s.length > 3 ? true : false);
}
/**
* @param newname any text as input.
* @returns return false to prevent default form submit behavior to refresh the page.
*/
addName(): boolean {
this.nameListService.add(this.newName);
this.newName = '';
return false;
}
} Tell me if you reproduce :) |
Hello @kitsonk So you can just do the following:
This should produce the following output: $ npm run serve.coverage
> angular2-seed@0.0.0 serve.coverage /Users/DonDope/Development/GitHub/TheDonDope/angular2-seed
> remap-istanbul -b src/ -i coverage/coverage-final.json -o coverage -t html && npm run gulp -- serve.coverage --color
/Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/report/html.js:288
text = structuredText[startLine].text;
^
TypeError: Cannot read property 'text' of undefined
at /Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/report/html.js:288:53
at Array.forEach (native)
at annotateBranches (/Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/report/html.js:255:30)
at HtmlReport.Report.mix.writeDetailPage (/Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/report/html.js:426:9)
at /Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/report/html.js:489:26
at SyncFileWriter.extend.writeFile (/Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/util/file-writer.js:57:9)
at FileWriter.extend.writeFile (/Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/util/file-writer.js:147:23)
at /Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/report/html.js:488:24
at Array.forEach (native)
at HtmlReport.Report.mix.writeFiles (/Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/node_modules/istanbul/lib/report/html.js:482:23)
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node/5.10.1/bin/node" "/usr/local/bin/npm" "run" "serve.coverage"
npm ERR! node v5.10.1
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! angular2-seed@0.0.0 serve.coverage: `remap-istanbul -b src/ -i coverage/coverage-final.json -o coverage -t html && npm run gulp -- serve.coverage --color`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-seed@0.0.0 serve.coverage script 'remap-istanbul -b src/ -i coverage/coverage-final.json -o coverage -t html && npm run gulp -- serve.coverage --color'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! remap-istanbul -b src/ -i coverage/coverage-final.json -o coverage -t html && npm run gulp -- serve.coverage --color
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-seed
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-seed
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/DonDope/Development/GitHub/TheDonDope/angular2-seed/npm-debug.log If you need any further help, just ping me. //cc @OlivierMary |
Thks @TheDonDope ;) I wanted to make that but I cant at work 😭 proxy 😭 |
@TheDonDope and @OlivierMary thanks... I will take a look. |
Hello folks! I think i have similar problem but I can't quite fix it. This is just a starter repo but the setup replicates my project. https://github.com/piq9117/codeCoverage
install dependencies:
run test and produce coverage
It will produce a coverage directory and the
UPDATE:
|
Still nothing working with inline sourcemap... 😢 |
Ok, we will investigate for 0.10.0... I don't have an ETA for that yet, but we'd of course welcome a PR if someone has time to look into this before we do! |
Hello,
I'm trying to migrate a Angular/JSPM project from old istambul instrumenters to remap-istambul, but we are facing an error and don't find any help on the documentation or previously opened ticket.
All the source of the project I'm talking about are available at the following url : https://github.com/davinkevin/angularjs-jspm-seed/tree/remap-istanbul
I've created a special branch with the modification made for this migration.
I have my Karma config like that :
And when I running all my test, all is ok, with the following results :
The lack of coverage is due to the transpilation of Babel, so it's for that I want to use remap-istanbul.
When I use the command
node_modules/.bin/remap-istanbul -i reports/coverage/coverage-final.json -o coverage-mapped.json
, I have the following result :But, in my Babel preprocessor config, I have defined the sourcemap as 'inline' or even 'both'.
And when I try to generate the html with the command
; node_modules/.bin/remap-istanbul -i reports/coverage/coverage-final.json -t html -o html-report
, I have the same errors at the beginning and after an error linked to istanbul itself.So, could you help us to understand where the problem come from ?
Thanks
/cc @aubm
The text was updated successfully, but these errors were encountered: