Skip to content

Commit

Permalink
feature: search on smokes
Browse files Browse the repository at this point in the history
  • Loading branch information
askonev committed Nov 16, 2023
1 parent cc4a1f1 commit 534a9e8
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 10 deletions.
14 changes: 8 additions & 6 deletions lib/coverage/test_coverage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module TestCoverage
}.freeze

SOURCES = {
'CDE' => File.join(Dir.pwd, 'js', 'docx').to_s,
'CSE' => File.join(Dir.pwd, 'js', 'xlsx').to_s,
'CPE' => File.join(Dir.pwd, 'js', 'pptx').to_s
'CDE' => File.join(Dir.pwd, 'js', 'docx', 'smoke').to_s,
'CSE' => File.join(Dir.pwd, 'js', 'xlsx', 'smoke').to_s,
'CPE' => File.join(Dir.pwd, 'js', 'pptx', 'smoke').to_s
}.freeze

# MethodCoverage class
Expand Down Expand Up @@ -49,7 +49,7 @@ def recursive_search(pattern = @pattern, node = @path)
def contains_matches?(path, pattern)
File.open(path, 'r') do |file|
file.each_line do |line|
next unless line.include?(pattern)
next unless line.include?("#{pattern}(")

@flag = true # Switch global flag
break
Expand Down Expand Up @@ -81,5 +81,7 @@ def self.run(method_list = get_api(ADDRESS))
end
end

result = TestCoverage.run
File.binwrite(File.join(Dir.pwd, 'reports', 'coverage_result.json').to_s, result)
# p TestCoverage::Matcher.new('SetData', 'js').pattern_found?

File.binwrite(File.join(Dir.pwd, 'reports', 'coverage_result.json').to_s,
TestCoverage.run)
Loading

0 comments on commit 534a9e8

Please sign in to comment.