From a6972191cf167266225ddcedc1c12ce94297ef1c Mon Sep 17 00:00:00 2001 From: Jordan Hawker Date: Wed, 10 Jun 2015 20:43:45 -0700 Subject: [PATCH 1/2] Fix renamer, lcov check was not accessing the proper object --- lib/reporters/lcov-reporter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/reporters/lcov-reporter.js b/lib/reporters/lcov-reporter.js index 02ac89f..a2aed92 100644 --- a/lib/reporters/lcov-reporter.js +++ b/lib/reporters/lcov-reporter.js @@ -1,13 +1,13 @@ var Reporter = require('../reporter'); var lcovRecord = function(data) { - var str = "", + var str = '', lineHandled = 0, lineFound = 0, fileName = data.fileName; - if(this.options.lcovOptions && this.options.lcovOptions.renamer){ - fileName = this.options.lcovOptions.renamer(fileName); + if (this.options.cliOptions && this.options.cliOptions.lcovOptions && this.options.cliOptions.lcovOptions.renamer){ + fileName = this.options.cliOptions.lcovOptions.renamer(fileName); } str += 'SF:' + fileName + '\n'; From 92c6b75dbd209f5e7fd20dd0f869f57c05afa7ba Mon Sep 17 00:00:00 2001 From: Jordan Hawker Date: Thu, 11 Jun 2015 09:40:44 -0700 Subject: [PATCH 2/2] Fix test --- tests/unit/reporters/lcov-reporter-test.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/unit/reporters/lcov-reporter-test.js b/tests/unit/reporters/lcov-reporter-test.js index 204a6c8..952a9d9 100644 --- a/tests/unit/reporters/lcov-reporter-test.js +++ b/tests/unit/reporters/lcov-reporter-test.js @@ -14,9 +14,11 @@ describe('LCOV Reporter', function() { it('should replace modules names with file names when requested', function () { var expectedOutput = fs.readFileSync(path.join(__dirname, '../../fixtures/lcov-output-with-renamer.dat'), 'utf8'); var reporter = new LCOVReporter({ - lcovOptions: { - renamer: function(moduleName){ - return moduleName.replace(/^todomvc-ember-cli/, 'something-else'); + cliOptions: { + lcovOptions: { + renamer: function (moduleName) { + return moduleName.replace(/^todomvc-ember-cli/, 'something-else'); + } } } });