SitePen / remap-istanbul

A tool for remapping Istanbul coverage via Source Maps
Other
240 stars 79 forks source link

Error during remaping and sourcemap not found #41

Open davinkevin opened 8 years ago

davinkevin commented 8 years ago

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 :

module.exports = function (config) {
  config.set({
    frameworks: ['jspm', 'jasmine', 'jasmine-matchers'],

    files: [
      '../node_modules/karma-babel-preprocessor/node_modules/babel-core/browser-polyfill.js'
    ],

    preprocessors: {
      'app/**/!(*.spec).js': ['babel', 'coverage']
    },

    babelPreprocessor: {
      options: {
        stage: 0,
        sourceMap: 'inline'
      }
    },

    basePath: 'public',

    jspm: {
      config: 'config.js',
      loadFiles: ['app/app.js', '**/*.spec.js'],
      serveFiles: ['**/*.+(js|html|css)'],
      stripExtension: true
    },

    proxies: {
      '/app/': '/base/app/',
      '/jspm_packages/': '/base/jspm_packages/'
    },

    reporters: ['dots', 'coverage'],

    coverageReporter: {
      dir: '../reports/coverage/',
      subdir: '.',
      reporters: [
        {type: 'html'}, {type: 'json'}, {type: 'lcov'}, {type: 'text-summary'}
      ]
    },

    browsers: ['PhantomJS'],
    singleRun : false,
    browserNoActivityTimeout: 75000
  });
};

And when I running all my test, all is ok, with the following results :

karma start karma.config.js --single-run
03 03 2016 10:07:37.804:INFO [karma]: Karma v0.13.21 server started at http://localhost:9876/
03 03 2016 10:07:37.810:INFO [launcher]: Starting browser PhantomJS
03 03 2016 10:07:39.120:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket /#3dcSXTFW9HzSPpfnAAAA with id 33417987
PhantomJS 1.9.8 (Mac OS X 0.0.0) INFO: 'Running app.func1 ...'
..............................
PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 30 of 30 SUCCESS (0.032 secs / 0.033 secs)

=============================== Coverage summary ===============================
Statements   : 92.06% ( 290/315 )
Branches     : 82.1% ( 133/162 )
Functions    : 86.89% ( 53/61 )
Lines        : 95.22% ( 239/251 )
================================================================================

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 :

[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/app.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/decorators.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/messages/messages.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/common/service/customLogService.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/config/route/route.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/messages/message/message.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/config/config.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/config/bootstrap/bootstrap.js"]

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.

[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/app.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/decorators.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/messages/messages.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/common/service/customLogService.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/config/route/route.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/messages/message/message.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/config/config.js"]
[Error: Could not find source map for: "/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/public/app/config/bootstrap/bootstrap.js"]
/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:241
            text = structuredText[startLine].text;
                                            ^

TypeError: Cannot read property 'text' of undefined
    at /Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:241:45
    at Array.forEach (native)
    at annotateFunctions (/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:224:26)
    at HtmlReport.Report.mix.writeDetailPage (/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:427:9)
    at /Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:489:26
    at SyncFileWriter.extend.writeFile (/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/util/file-writer.js:57:9)
    at FileWriter.extend.writeFile (/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/util/file-writer.js:147:23)
    at /Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:488:24
    at Array.forEach (native)
    at HtmlReport.Report.mix.writeFiles (/Users/kdavin/Workspace/GitHub/angularjs-jspm-seed/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:482:23)

So, could you help us to understand where the problem come from ?

Thanks

/cc @aubm

JaKXz commented 8 years ago

+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 code property of the JSON file I'm passing as the input file to remap-istanbul -i.

shaharmor commented 8 years ago

If you have the source map inlined inside the coverage.json file in the code property, you can do something like this: https://github.com/SitePen/remap-istanbul/pull/43 and it will work

kitsonk commented 8 years ago

Correct, we don't currently support inline code, though the PR from @shaharmor will address this.

kitsonk commented 8 years ago

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 b71425492471fc2f3934af3b085d0f980bb7ef1d including tests. I also realised that if there are inline sources in the source-map, that though should be copied out to the coverage.json. It will basically add code for any situation where it has determined the source map contains the sources, source if the original unmapped coverage file contains a code property and that code property has an inline source-map with inline sources, then the resulting output will include remapped coverage and code property.

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.

davinkevin commented 8 years ago

Thanks for you work, I'll try this as soon as possible.

OlivierMary commented 8 years ago

Hi @kitsonk I try it and it's same problem for me on 0.6.3 version.

mgechev/angular2-seed#716

kitsonk commented 8 years ago

@oliviermary is there any way I can get an coverage.json and a .map or a source file with the inline source map?

I notice it is using Gulp, I need to check if the Gulp plugin is properly passing the Instanbul MemoryStore that contains the sources.

OlivierMary commented 8 years ago

Hi @kitsonk you have all the information to reproduce on mgechev/angular2-seed#716

It's easier if you reproduce from this seed ;)

kitsonk commented 8 years ago

I am pretty sure I know what it is and how to fix it and will tomorrow AM my time.

kitsonk commented 8 years ago

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 angular2-seed project, did the npm test and then:

$ npm run serve.coverage

> angular2-seed@0.0.0 serve.coverage /Users/kitsonk/github/angular2-seed
> remap-istanbul -b src/ -i coverage/coverage-final.json -o coverage -t html && npm run gulp -- serve.coverage --color

> angular2-seed@0.0.0 gulp /Users/kitsonk/github/angular2-seed
> gulp "serve.coverage" "--color"

[08:11:03] Requiring external module ts-node/register
[08:11:05] Loading tasks folder /Users/kitsonk/github/angular2-seed/tools/tasks/seed
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.assets.dev
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.assets.prod
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.bundles.app
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.bundles
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.docs
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.html_css
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.index.dev
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.index.prod
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.js.dev
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.js.e2e
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.js.prod
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.js.test
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/build.js.tools
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/check.versions
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/clean.all
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/clean.dev
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/clean.prod
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/clean.tools
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/copy.js.prod
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/css-lint
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/karma.start
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/serve.coverage
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/serve.docs
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/server.prod
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/server.start
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/tslint
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/watch.dev
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/watch.e2e
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/seed/watch.test
[08:11:05] Loading tasks folder /Users/kitsonk/github/angular2-seed/tools/tasks/project
[08:11:05] Registering task ~/github/angular2-seed/tools/tasks/project/sample.task
[08:11:05] Using gulpfile ~/github/angular2-seed/gulpfile.ts
[08:11:05] Starting 'serve.coverage'...
[08:11:05] Finished 'serve.coverage' after 6.56 ms

So if the error persists, I don't thing you have 0.6.3 installed (or there is something else going on that is outside of the scope of remap-istanbul).

OlivierMary commented 8 years ago

@kitsonk did you change home.component.ts with filter like me ?

Without this change you can't reproduce ;)

kitsonk commented 8 years ago

I copied exactly what you had in your example. It caused errors in karma and there were errors during the build.

/Users/kitsonk/github/angular2-seed/src/client/app/+home/components/home.component.ts
      line 31  col 2  file should end with a newline

    ✖ 1 error

[08:08:44] Finished 'tslint' after 1.77 s
[08:08:44] Starting 'build.assets.dev'...
[08:08:44] Finished 'build.assets.dev' after 40 ms
[08:08:44] Starting 'build.js.test'...
[08:08:44] Plumber found unhandled error:
 Error in plugin 'gulp-inline-ng2-template'
Message:
    ENOENT: no such file or directory, open '/Users/kitsonk/github/angular2-seed/src/client/home.component.html'
Details:
    errno: -2
    code: ENOENT
    syscall: open
    path: /Users/kitsonk/github/angular2-seed/src/client/home.component.html
    fileName: /Users/kitsonk/github/angular2-seed/src/client/app/+home/components/home.component.ts
[08:08:46] Finished 'build.js.test' after 2.24 s
[08:08:46] Starting 'build.index.dev'...
[08:08:46] gulp-inject 5 files into index.html.
[08:08:46] gulp-inject 4 files into index.html.
[08:08:46] gulp-inject 1 files into index.html.
[08:08:46] Finished 'build.index.dev' after 112 ms
[08:08:46] Finished 'build.test' after 4.18 s
[08:08:46] Starting 'karma.start'...

START:
18 04 2016 08:08:48.395:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
18 04 2016 08:08:48.401:INFO [launcher]: Starting browser PhantomJS
18 04 2016 08:08:48.415:INFO [launcher]: Starting browser Chrome
18 04 2016 08:08:49.388:INFO [Chrome 49.0.2623 (Mac OS X 10.11.4)]: Connected on socket /#4xGh2dGPvX7IHjGgAAAA with id 16171259
18 04 2016 08:08:49.566:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#wEo5WVp3rpdtbswXAAAB with id 16584753
18 04 2016 08:08:50.840:WARN [web-server]: 404: /base/dist/dev/app/+home/components/home.component.js
Chrome 49.0.2623 (Mac OS X 10.11.4) ERROR: Error{originalErr: Error{}}
18 04 2016 08:08:50.966:WARN [web-server]: 404: /base/dist/dev/app/+home/components/home.component.js
18 04 2016 08:08:51.014:WARN [web-server]: 404: /base/dist/dev/app/+home/components/home.component.js
ERROR: Error{stack: null, originalErr: Error{}, line: 821, sourceURL: 'http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?e1a1843273d23ee5028aa25121066ce32fecdb29'}
18 04 2016 08:08:51.194:WARN [web-server]: 404: /base/dist/dev/app/+home/components/home.component.js
  About component
    ✔ should work

Finished in 0.134 secs / 0.221 secs

SUMMARY:
✔ 2 tests completed

=============================== Coverage summary ===============================
Statements   : 76.92% ( 20/26 )
Branches     : 48.28% ( 14/29 )
Functions    : 62.5% ( 5/8 )
Lines        : 81.82% ( 18/22 )
================================================================================

=============================== Coverage summary ===============================
Statements   : 76.92% ( 20/26 )
Branches     : 48.28% ( 14/29 )
Functions    : 62.5% ( 5/8 )
Lines        : 81.82% ( 18/22 )
================================================================================

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.

OlivierMary commented 8 years ago

@kitsonk they change structure of project : new file to reproduce

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 :)

TheDonDope commented 8 years ago

Hello @kitsonk I provide you a fork of the repo with a branch that already has the reproducer included so you don't have to do all the work on your own.

So you can just do the following:

  1. Clone the repo: $ git clone git@github.com:TheDonDope/angular2-seed.git
  2. Checkout the reproducer branch: $ git checkout remap-instanbul-issue
  3. Install the npm dependencies: $ npm install
  4. Run the test task: $ npm test
  5. Run the coverage report task: $ npm run serve.coverage

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

OlivierMary commented 8 years ago

Thks @TheDonDope ;) I wanted to make that but I cant at work :sob: proxy :sob:

kitsonk commented 8 years ago

@TheDonDope and @OlivierMary thanks... I will take a look.

piq9117 commented 7 years ago

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 clone:

$ git clone https://github.com/piq9117/codeCoverage.git

install dependencies:

$ npm install 

run test and produce coverage

$ npm run test:single

It will produce a coverage directory and the coverage-final.json but the test doesnt exit and instead give this error:

 Error: Could not find source map for: "C:\Users\Ken\Documents\codeCoverage\karma.entry.js"
    at C:\Users\Ken\Documents\codeCoverage\node_modules\remap-istanbul\lib\remap.js:213:11
    at Array.forEach (native)
    at C:\Users\Ken\Documents\codeCoverage\node_modules\remap-istanbul\lib\remap.js:192:22
    at Array.forEach (native)
    at remap (C:\Users\Ken\Documents\codeCoverage\node_modules\remap-istanbul\lib\remap.js:191:12)
    at KarmaRemapIstanbul.onRunComplete (C:\Users\Ken\Documents\codeCoverage\node_modules\karma-remap-istanbul\index.js:55:21)
    at Server.<anonymous> (C:\Users\Ken\Documents\codeCoverage\node_modules\karma\lib\events.js:13:22)
    at emitTwo (events.js:111:20)
    at Server.emit (events.js:191:7)
    at emitRunCompleteIfAllBrowsersDone (C:\Users\Ken\Documents\codeCoverage\node_modules\karma\lib\server.js:294:12)
    at Server.<anonymous> (C:\Users\Ken\Documents\codeCoverage\node_modules\karma\lib\server.js:325:7)
    at emitOne (events.js:96:13)
    at Server.emit (events.js:188:7)
    at Server.<anonymous> (C:\Users\Ken\Documents\codeCoverage\node_modules\karma\lib\server.js:308:12)
    at emitOne (events.js:101:20)
    at Server.emit (events.js:188:7)
20 12 2016 09:48:20.311:ERROR [karma]: TypeError: Cannot read property 'text' of undefined
    at C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:288:53
    at Array.forEach (native)
    at annotateBranches (C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:255:30)
    at HtmlReport.writeDetailPage (C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:426:9)
    at C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:489:26
    at SyncFileWriter.writeFile (C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\util\file-writer.js:57:9)
    at FileWriter.writeFile (C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\util\file-writer.js:147:23)
    at C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:488:24
    at Array.forEach (native)
    at HtmlReport.writeFiles (C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:482:23)
    at C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:484:22
    at Array.forEach (native)
    at HtmlReport.writeFiles (C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:482:23)
    at HtmlReport.writeReport (C:\Users\Ken\Documents\codeCoverage\node_modules\istanbul\lib\report\html.js:566:14)
    at C:\Users\Ken\Documents\codeCoverage\node_modules\remap-istanbul\lib\writeReport.js:77:22
    at C:\Users\Ken\Documents\codeCoverage\node_modules\remap-istanbul\node_modules\amdefine\amdefine.js:125:34

UPDATE: I solve my problem by just fixing this part of the config file:

preprocessors: {
      'karma.entry.js': ['webpack', 'sourcemap-writer', 'coverage'],
      'webpack.test.js': ['webpack', 'sourcemap', 'sourcemap-writer', 'coverage'],
      './src/**/!(*.spec.*)+(.ts|.js)': ['sourcemap']
    },
davinkevin commented 7 years ago

Still nothing working with inline sourcemap... 😢

dylans commented 7 years ago

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!