lib/generate-report.js
/**
     * Parse each scenario within a feature
     * @param {object} feature a feature with all the scenarios in it
     * @return {object} return the parsed feature
     * @private
     */
Parse each scenario within a feature
@param {object} feature a feature with all the scenarios in it
@return {object} return the parsed feature
@private
Parse each scenario within a feature @param { object } feature a feature with all the scenarios in it @return { object } return the parsed feature @private
function _parseScenarios(feature) {
        feature.elements.forEach(scenario => {
            scenario.passed = 0
            scenario.failed = 0
            scenario.notDefined = 0
            scenario.skipped = 0
            scenario.pending = 0
            scenario.ambiguous = 0
            scenario.duration = 0
            scenario.time = '00:00:00.000'
            scenario = _parseSteps(scenario)
            if (scenario.duration > 0) {
                feature.duration += scenario.duration
                scenario.time = formatDuration(scenario.duration)
            }
            if (scenario.hasOwnProperty('description') && scenario.description) {
                scenario.description = scenario.description.replace(new RegExp('\r?\n', 'g'), '<br />')
            }
            if (scenario.failed > 0) {
                suite.scenarios.total++
                suite.scenarios.failed++
                feature.scenarios.total++
                feature.isFailed = true
                return feature.scenarios.failed++
            }
            if (scenario.ambiguous > 0) {
                suite.scenarios.total++
                suite.scenarios.ambiguous++
                feature.scenarios.total++
                feature.isAmbiguous = true
                return feature.scenarios.ambiguous++
            }
            if (scenario.notDefined > 0) {
                suite.scenarios.total++
                suite.scenarios.notDefined++
                feature.scenarios.total++
                feature.isNotdefined = true
                return feature.scenarios.notDefined++
            }
            if (scenario.pending > 0) {
                suite.scenarios.total++
                suite.scenarios.pending++
                feature.scenarios.total++
                feature.isPending = true
                return feature.scenarios.pending++
            }
            if (scenario.skipped > 0) {
                suite.scenarios.total++
                suite.scenarios.skipped++
                feature.scenarios.total++
                return feature.scenarios.skipped++
            }
            if (scenario.passed > 0) {
                suite.scenarios.total++
                suite.scenarios.passed++
                feature.scenarios.total++
                return feature.scenarios.passed++
            }
        })
        feature.isSkipped = feature.scenarios.total === feature.scenarios.skipped
        return feature
    }
function _parseScenarios ( feature ) { feature . elements . forEach ( scenario => { scenario . passed = 0 scenario . failed = 0 scenario . notDefined = 0 scenario . skipped = 0 scenario . pending = 0 scenario . ambiguous = 0 scenario . duration = 0 scenario . time = '00:00:00.000' scenario = _parseSteps ( scenario ) if ( scenario . duration > 0 ) { feature . duration += scenario . duration scenario . time = formatDuration ( scenario . duration ) } if ( scenario . hasOwnProperty ( 'description' ) && scenario . description ) { scenario . description = scenario . description . replace ( new RegExp ( '\r?\n' , 'g' ) , '<br />' ) } if ( scenario . failed > 0 ) { suite . scenarios . total ++ suite . scenarios . failed ++ feature . scenarios . total ++ feature . isFailed = true return feature . scenarios . failed ++ } if ( scenario . ambiguous > 0 ) { suite . scenarios . total ++ suite . scenarios . ambiguous ++ feature . scenarios . total ++ feature . isAmbiguous = true return feature . scenarios . ambiguous ++ } if ( scenario . notDefined > 0 ) { suite . scenarios . total ++ suite . scenarios . notDefined ++ feature . scenarios . total ++ feature . isNotdefined = true return feature . scenarios . notDefined ++ } if ( scenario . pending > 0 ) { suite . scenarios . total ++ suite . scenarios . pending ++ feature . scenarios . total ++ feature . isPending = true return feature . scenarios . pending ++ } if ( scenario . skipped > 0 ) { suite . scenarios . total ++ suite . scenarios . skipped ++ feature . scenarios . total ++ return feature . scenarios . skipped ++ } if ( scenario . passed > 0 ) { suite . scenarios . total ++ suite . scenarios . passed ++ feature . scenarios . total ++ return feature . scenarios . passed ++ } } ) feature . isSkipped = feature . scenarios . total === feature . scenarios . skipped return feature }
Parse each scenario within a feature
 @param {object} feature a feature with all the scenarios in it
 @return {object} return the parsed feature
 @private
Parse each scenario within a feature @param { object } feature a feature with all the scenarios in it @return { object } return the parsed feature @private
/* istanbul ignore else */