Skip to content

Commit

Permalink
Recognize Building notice as not an error
Browse files Browse the repository at this point in the history
  • Loading branch information
kobsy authored and seanpdoyle committed Dec 20, 2021
1 parent f750eb8 commit d68d804
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ember_cli/build_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def error_file_exists?
def build_errors
error_lines.
reject { |line| is_blank_or_backtrace?(line) }.
reject { |line| is_deprecation_warning?(line) }
reject { |line| is_deprecation_warning?(line) }.
reject { |line| is_building_notice?(line) }
end

def has_build_errors?
Expand All @@ -57,6 +58,10 @@ def is_deprecation_warning?(line)
line =~ /^(\e[^\s]+)?DEPRECATION:/
end

def is_building_notice?(line)
line =~ /^(\e[^\s]+)?.\s(\e[^\s]+)?Building/
end

def error_lines
if error_file_exists?
error_file.readlines
Expand Down
13 changes: 13 additions & 0 deletions spec/lib/ember_cli/build_monitor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@
end
end

context "when the error file contains an ASCII colored Building notice" do
it "does not raise a BuildError" do
error_file = error_file_with_contents(
[
"- \e[32mBuilding\e[39m"
])
paths = build_paths(error_file)
monitor = EmberCli::BuildMonitor.new(nil, paths)

expect(monitor.check!).to be true
end
end

context "when the error file contains both errors & deprecation warnings" do
it "raises a BuildError" do
error_file = error_file_with_contents(
Expand Down

0 comments on commit d68d804

Please sign in to comment.