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

Debug original function invoked by spec #119

Closed
masimplo opened this issue Jul 11, 2016 · 5 comments
Closed

Debug original function invoked by spec #119

masimplo opened this issue Jul 11, 2016 · 5 comments

Comments

@masimplo
Copy link

masimplo commented Jul 11, 2016

Hi,

not sure if this has been answered before, but couldn't find anything related.
I am trying to debug why a test fails and although using npm run karma and opening a second tab with debug as per instructions gives me the ability to add break points to the spec code, the code to be tests is minified and I cannot place a break point there. Debugging the actual test code is only half the story. Am I missing something?

screenshot 2016-07-11 16 21 42

I also clicked on the notification about pretty printing the minified file, which made no difference

@lathonez
Copy link
Owner

No, you're right. Apparently I've not had to dig this far before. It's exactly as you say.

The (source) source map works with npm start so hopefully we're just missing some config.

@lathonez
Copy link
Owner

It's the transform that breaks it for some reason, these lines here:

https://github.com/lathonez/clicker/blob/master/test/karma.config.js#L39-L44

My plan is to:

  • remove transform from karma-debug as we're not using the coverage there anyway, thereby solving your issue
  • remove source maps from npm test (straight karma run) to give quicker tests

@lathonez
Copy link
Owner

I didn't end up removing the sourcemaps from npm test in the end. I didn't notice much difference in transpile time and they do give (more) useful traces when things go wrong.

Removing the transform from debug mode has solved the issue for me:

screenshot-20160712102810-1118x618

@masimplo
Copy link
Author

Awesome, just tried it and it works great. Thanks for the quick resolution.

@lathonez
Copy link
Owner

No worries thanks for raising!

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