class DeepCover::Reporter::Istanbul::CoveredCodeConverter
Public Instance Methods
branch_map()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 94 def branch_map branches.map do |node, branches_runs| convert_branch(node, branches_runs.keys) end end
branch_runs()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 105 def branch_runs branches.values.map { |r| nil_to_something(r.values) } end
branches()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 90 def branches @branches ||= Analyser::Branch.new(node_analyser, **options).results end
convert()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 136 def convert { path: covered_code.path, **data.transform_values { |l| convert_list(l) }, } end
data()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 125 def data { statementMap: statement_map, s: statement_runs, fnMap: function_map, f: function_runs, branchMap: branch_map, b: branch_runs, } end
function_map()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 117 def function_map functions.keys.map { |n| convert_function(n) } end
function_runs()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 121 def function_runs functions.values end
functions()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 82 def functions @functions ||= Analyser::Function.new(node_analyser, **options).results end
nil_to_something(values)
click to toggle source
Istanbul
doesn't understand how to ignore a branch…
# File lib/deep_cover/reporter/istanbul.rb, line 101 def nil_to_something(values) values.map { |v| v || 1 } end
node_analyser()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 74 def node_analyser @node_analyser ||= Analyser::Node.new(covered_code, **options) end
node_runs()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 78 def node_runs @node_runs ||= node_analyser.results end
statement_map()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 109 def statement_map statements.keys.map { |range| convert_range(range) } end
statement_runs()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 113 def statement_runs statements.values end
statements()
click to toggle source
# File lib/deep_cover/reporter/istanbul.rb, line 86 def statements @statements ||= Analyser::Statement.new(node_analyser, **options).results end