piotrwitek / ts-mocha

Mocha thin wrapper that allows running TypeScript tests with TypeScript runtime (ts-node) to get rid of compilation complexity
MIT License
190 stars 25 forks source link

Correct stack traces using source-map-support #54

Open tomchambers2 opened 4 years ago

tomchambers2 commented 4 years ago

Is it possible to use source-map-support to have stack traces refer to the uncompiled source? It's quite tricky seeing where errors in tests have come from at present.

cmawhorter commented 4 years ago

i've been adding ts-mocha -r source-map-support/register which gets stack traces mostly working.

but i've noticed some of the low-line-number (e.g. line 8) refer to something that i'm assuming typescript injects. the rest of the line numbers are accurate though so it hasn't been a problem to just ignore those