From d7209d784e7dee7871373d38af8925541c42835c Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Mon, 18 Jul 2016 10:56:25 -0700 Subject: [PATCH] Add option to print current spec name to jasmine --- spec/helpers/helper.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/helpers/helper.js b/spec/helpers/helper.js index f133f469c..0d90c2cdc 100644 --- a/spec/helpers/helper.js +++ b/spec/helpers/helper.js @@ -49,6 +49,15 @@ console.error = function() { console.log.apply(console, arguments); }; +if (process.argv.indexOf('--with-test-names') > -1) { + jasmine.getEnv().addReporter({ + specStarted: function(result){ + // Printing weirdly so pass/fail indicator is on the same line as the test name + process.stdout.write('\n' + result.fullName); + } + }) +} + var initialized = false; beforeEach(function(done) { if (initialized) {