1

I am trying for many days now to have typescript breakpoints hit in my mocha tests with no success. They keep getting hit in the .js files, not the typescript source files. I am using vscode 1.9.1. I have already asked a similar question here with yet no answer yet. I am been reading several similar issues here on stackoverflow and on google. No solution has worked for me.

Here is a screenshot of the breakpoint been hit in the .js file, not the typescript:

enter image description here

This file is a read-only file which seems to be produced by mocha at run-time. The strange thing here is that I see sourcemaps characters inserted at the end of the .js file although in my tsconfig.json (below) I have the option "sourceMap": true which means that sourcemaps are a separate file.

I suspect this is the cause of my problem. I have been pulling my hair for many days, looking for a solution all over internet. It seems that many people face the same problem. Sure there must someone who has been able to debug mocha + typescript files .

P.S

This is React + Typescript application. In a React-Native application I am developping, there my typescript mocha test files have their breakpoints hit.

  1. here is my tsconfig.json:

enter image description here

I have tried various combinations (sourceMaps:true, removing sourceRoot...etc)

  1. Here is my lauchn.json

enter image description here

Community
  • 1
  • 1
TheSoul
  • 4,906
  • 13
  • 44
  • 74
  • you can try look through the issues on vscode repository, maybe there will be something helpful: https://github.com/Microsoft/vscode/issues , here is a similar one: https://github.com/Microsoft/vscode/issues/3144 – niba Apr 23 '17 at 14:53

0 Answers0