Better stacktrace
See original GitHub issueI am using your code to implement the unit test in my project, but I have errors when running Karma and the stacktrace makes it impossible to debug what is actually going wrong. Example:
FAILED TESTS:
MyApp
✖ initialises with one possible page
PhantomJS 2.0.0 (Mac OS X 0.0.0)
TypeError: undefined is not an object (evaluating 'provider.toString') (line 180)
at
at
at forEach ([native code])
at
at
at
at
at
at /Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/test/karma/tests.config.js:41:18
at run (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1217:29)
at zoneBoundFn (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1194:29)
at lib$es6$promise$$internal$$tryCatch (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:442:25)
at lib$es6$promise$$internal$$invokeCallback (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:454:53)
at lib$es6$promise$$internal$$publish (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:425:53)
at /Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:97:12
at run (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1217:29)
at zoneBoundFn (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1194:29)
at lib$es6$promise$asap$$flush (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:236:18)
TypeError: null is not an object (evaluating 'myApp.pages') (line 37)
at
at /Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/test/karma/tests.config.js:41:18
at run (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1217:29)
at zoneBoundFn (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1194:29)
at lib$es6$promise$$internal$$tryCatch (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:442:25)
at lib$es6$promise$$internal$$invokeCallback (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:454:53)
at lib$es6$promise$$internal$$publish (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:425:53)
at /Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:97:12
at run (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1217:29)
at zoneBoundFn (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:1194:29)
at lib$es6$promise$asap$$flush (/Users/groyer/Documents/workspace/helperchoice/helpizr-app-v2/node_modules/zone.js/dist/zone-microtask.js:236:18)
Is there any way to know in which file this line 180
is located? or have the complete stacktrace with no empty lines? thanks
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
axios-better-stacktrace - npm
Axios plugin that provides better stack traces for axios errors. Latest version: 2.1.3, last published: 2 months ago.
Read more >Stack Trace Formatter - Pretty print your exception messages
Using the .NET stack trace formatter, you can pretty print any stack trace and either copy and paste it or download a screenshot...
Read more >Improve axios stack traces · Issue #2387 - GitHub
I create an Error in a request interceptor, store it on a config property, then use its stack trace in the response interceptor's...
Read more >Stack Trace Enhancements and Filters - Sentry
Like stack traces, but more and better. Sentry enhances stack traces with all the information you wish they had. Try Sentry For FreeSee...
Read more >How do I get a better stack trace on Angular errors
Generally Javascript stack traces are more useful. Unfortunately, in a production application you generally turn on minification, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey thanks for reaching out!
I haven’t found a way of getting a better stack trace using PhatomJS2.
Here’s the way I do it:
You should see Chrome pops up and runs through all the tests. As we’ve set singleRun to false, Karma should leave Chrome open at the end. On Chrome you should see Jasmine’s home page, with a DEBUG button in the top right hand corner. If you click DEBUG, it’ll open in a new tab and run through the tests again. F12 for dev tools and you should have a proper stack trace.
Incidentally I’ve switched to using Chrome full time personally (instead of PhantomJS2).
Let me know how go.
I’ve added watch and debug functionality similar to angular 2 seed: 5fcaaf4. Updated README with instructions.