karma-runner / gulp-karma

Example of using Karma with Gulp.
310 stars 41 forks source link

Clean up error reporting trace when tests fail. #33

Open brocksamson opened 8 years ago

brocksamson commented 8 years ago

When tests fail using the recipe in you get a really ugly stack trace after the error.

PhantomJS 2.1.1 (Linux 0.0.0): Executed 598 of 601 (2 FAILED) (skipped 3) (2.735 secs / 2.694 secs) [15:07:06] 'test' errored after 3.46 s [15:07:06] Error: 2 at formatError (/home/matt/.nvm/versions/node/v4.4.7/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/formatError.js:20:10) at Gulp.<anonymous> (/home/matt/.nvm/versions/node/v4.4.7/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/log/events.js:41:15) at emitOne (events.js:77:13) at Gulp.emit (events.js:169:7) at Gulp.Orchestrator._emitTaskDone (/home/matt/code/notify_me/node_modules/gulp/node_modules/orchestrator/index.js:264:8) at /home/matt/code/notify_me/node_modules/gulp/node_modules/orchestrator/index.js:275:23 at finish (/home/matt/code/notify_me/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8) at cb (/home/matt/code/notify_me/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3) at removeAllListeners (/home/matt/code/notify_me/node_modules/karma/lib/server.js:379:7) at Server.<anonymous> (/home/matt/code/notify_me/node_modules/karma/lib/server.js:390:9) at Server.g (events.js:260:16) at emitNone (events.js:72:20) at Server.emit (events.js:166:7) at emitCloseNT (net.js:1537:8) at nextTickCallbackWith1Arg (node.js:431:9) at process._tickCallback (node.js:353:17)

I'm working on a PR to alter the output to something more readable (initial version):

PhantomJS 2.1.1 (Linux 0.0.0): Executed 598 of 601 (2 FAILED) (skipped 3) (2.736 secs / 2.711 secs) [15:10:13] 'test' errored after 3.46 s [15:10:13] karma in plugin 'karma' Message: 2 Tests failed