Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Support source mapping of stack traces in the Debug Console #6 #190

Merged
merged 5 commits into from
Mar 23, 2017
Merged

Support source mapping of stack traces in the Debug Console #6 #190

merged 5 commits into from
Mar 23, 2017

Conversation

nojvek
Copy link
Contributor

@nojvek nojvek commented Mar 22, 2017

Will add some tests tomorrow. Still figuring out how tests work with sourcemap mocks.

Let me know if the code section looks good by you.

@auchenberg @roblourens

@nojvek nojvek self-assigned this Mar 22, 2017
@roblourens
Copy link
Member

Thanks, this looks great! Tests are always welcome.

if (matches) {
const fnName = matches[1];
const path = matches[2];
const lineNum = parseInt(matches[3]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TSLint failes due to missing radex param.

@nojvek
Copy link
Contributor Author

nojvek commented Mar 22, 2017

Just installed tslint plugin for vscode. Just realized that that it now has tslint.autofix like eslint.

I press save and everything fixes itself. So awesome 😎 🎉

@nojvek
Copy link
Contributor Author

nojvek commented Mar 22, 2017

@roblourens I am trying to get the unit test for exceptions to work.

Firing mockEventEmitter.emit('Runtime.exceptionThrown', ... but that never ends up calling onExceptionThrown even thought the handler is run this.chrome.Runtime.onExceptionThrown(params => this.onExceptionThrown(params));. Weird, am I doing something obviously wrong that I can't see?

My test strategy is to fire a bunch of Runtime.exceptionThrown events, mock the sourcemapper and pathmapper and check the final exception string sent to client is source mapped.

@roblourens
Copy link
Member

Looks like there's a typo in my mock event handling code - https://github.com/Microsoft/vscode-chrome-debug-core/blob/master/test/mocks/debugProtocolMocks.ts#L51 - should be Runtime.exceptionThrown not onExceptionThrown.

@nojvek
Copy link
Contributor Author

nojvek commented Mar 23, 2017

@roblourens Thanks for the pointer.

Making mocks work properly was a mission but I think I have it all working now.

@nojvek
Copy link
Contributor Author

nojvek commented Mar 23, 2017

Tested on dummy and webpack projects. I'm lovin it

image

@roblourens
Copy link
Member

Awesome, thanks for the tests

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

Successfully merging this pull request may close these issues.

4 participants