git-approvals 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -85,7 +85,12 @@ EOS
|
|
85
85
|
register_formatter :js do |object|
|
86
86
|
require 'uglifier'
|
87
87
|
Uglifier.compile object,
|
88
|
-
:output => {
|
88
|
+
:output => {
|
89
|
+
:beautify => true,
|
90
|
+
:indent_level => 2,
|
91
|
+
:comments => :all,
|
92
|
+
:space_colon => true
|
93
|
+
}
|
89
94
|
end
|
90
95
|
|
91
96
|
def initialize( path, options={} ) # :nodoc:
|
data/spec/fixtures/asset.js
CHANGED
@@ -71,7 +71,10 @@ describe Git::Approvals::Approval do
|
|
71
71
|
end
|
72
72
|
it 'formats javascript' do
|
73
73
|
approval = described_class.new './spec/fixtures/asset.js', :format => :js
|
74
|
-
approval.diff(
|
74
|
+
approval.diff( <<-EOS ){ |diff| fail diff }
|
75
|
+
// Comments are preserved
|
76
|
+
(function(){return {status:"IT WERKS"};})();
|
77
|
+
EOS
|
75
78
|
end
|
76
79
|
end
|
77
80
|
end
|