Skip to content
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

stepping into code debugging source not working #2

Open
darewreck54 opened this issue Jun 2, 2018 · 4 comments
Open

stepping into code debugging source not working #2

darewreck54 opened this issue Jun 2, 2018 · 4 comments

Comments

@darewreck54
Copy link

Hi,

So i had two issue initially when i ran your example. One was addressed here #1 with the fix of adding a different configuration in launch.

Afterwards, I wrote some extra code and tried to step into it. However, whenever i stepped into the method it would not line up or it would be off by a line. I'm guessing there is some is something i'm missing about the source mapping.

https://github.com/darewreck54/ts-jest-sample

if you run this repo, and put a break point at line 29 sound-consumer.spec.ts and step into it, you'll notice that you are off by a line. It will jump to the file, but be one line offset of where it should be.

Also if you update the version of
"devDependencies": {
"@types/jest": "^23.0.0",
"jest": "^23.1.0",
"typescript": "^2.9.1"
},
"scripts": {
"compile": "tsc",
"test": "jest"
},
"dependencies": {
"ts-jest": "^22.4.6"
}

and run it again, you will notice that when you step into the same file, it will be way off; whether its stepping into the contructor of SoundPlayerConsumer or when you step into the method playSoundFile

i'm currently using npm 6.1.0 and node 8.11.2

Any idea how to fix the source mapping issue?

Thanks,
Derek

@darewreck54
Copy link
Author

it seeems to not account for the extra lines between the functions in the real class that your testing. If you were to put a bunch of new lines between the methods, you'll clearly see the issue with the break points not lining up

@xogeny
Copy link
Collaborator

xogeny commented Jun 3, 2018

You really have to report this to the ts-jest people. I would post an issue with your repo that reproduces the issue. I'm just trying to show a sample project here, not fix bugs in their project. But, if you find that I've misconfigured something, I'll gladly accept a PR.

@darewreck54
Copy link
Author

Sure thing, I can post it on ts-jest. I just wasn't sure if i'ts related to ts-jest, or vs code or even to the node version. Since it works from command line. Just wanted to get your perspective if I was missing something in how ts-jest should be configured.

Thanks anyways

@darewreck54
Copy link
Author

Also I believe it's related to the codecoverage being set to true.

kulshekhar/ts-jest#484

There is a bug related to debugging when coverage is turned on. After i fixed that, it seemed to work
Derek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants